From 5745ffa0a894cb129f2ac266706d6f7c8c47a958 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 31 Aug 2021 09:13:54 +0200 Subject: [PATCH] ci: don't login to docker on forks Signed-off-by: Jens Langhammer --- .github/workflows/ci-main.yml | 4 ++-- .github/workflows/ci-outpost.yml | 2 ++ authentik/flows/management/commands/benchmark.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 349cc0f45..b59ce14ad 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -179,8 +179,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1.2.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: prepare variables @@ -189,6 +187,7 @@ jobs: python ./scripts/gh_do_set_branch.py - name: Login to GitHub Container Registry uses: docker/login-action@v1 + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: registry: beryju.org username: ${{ secrets.HARBOR_USERNAME }} @@ -196,6 +195,7 @@ jobs: - name: Building Docker Image uses: docker/build-push-action@v2 with: + push: ${{ github.event.pull_request.head.repo.full_name == github.repository }} tags: | beryju.org/authentik/server:gh-${{ steps.ev.outputs.branchName }}, beryju.org/authentik/server:gh-${{ env.GITHUB_SHA }} diff --git a/.github/workflows/ci-outpost.yml b/.github/workflows/ci-outpost.yml index e7c72c11a..89d151890 100644 --- a/.github/workflows/ci-outpost.yml +++ b/.github/workflows/ci-outpost.yml @@ -47,6 +47,7 @@ jobs: python ./scripts/gh_do_set_branch.py - name: Login to GitHub Container Registry uses: docker/login-action@v1 + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: registry: beryju.org username: ${{ secrets.HARBOR_USERNAME }} @@ -54,6 +55,7 @@ jobs: - name: Building Docker Image uses: docker/build-push-action@v2 with: + push: ${{ github.event.pull_request.head.repo.full_name == github.repository }} tags: | beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}, beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}-${{ steps.ev.outputs.timestamp }}, diff --git a/authentik/flows/management/commands/benchmark.py b/authentik/flows/management/commands/benchmark.py index 5b445357a..fec2cfd31 100644 --- a/authentik/flows/management/commands/benchmark.py +++ b/authentik/flows/management/commands/benchmark.py @@ -31,6 +31,7 @@ class FlowPlanProcess(PROCESS_CLASS): # pragma: no cover self.request = RequestFactory().get("/") def run(self): + """Execute 1000 flow plans""" print(f"Proc {self.index} Running") def test_inner():