Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Docker Login Improvements (#394)
Browse files Browse the repository at this point in the history
Previously the Docker Login step in many of the workflows was executed
regardless of whether it was necessary.  This would have been find except that
the required secrets were not available in PRs from forks.  This change
removes the Docker Login steps from where it is not necessary and puts a guard
on its execution in workflows that are run as part of PRs.

Signed-off-by: Ben Hale <bhale@vmware.com>
  • Loading branch information
nebhale authored Oct 14, 2020
1 parent debec23 commit 03dd09e
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/create-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minimal-labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Minimal Labels
"on":
pull_request_target:
pull_request:
types:
- synchronize
- reopened
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests
"on":
pull_request_target: {}
pull_request: {}
push:
branches:
- main
Expand All @@ -10,7 +10,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-bellsoft-liberica.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-command-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-java-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-leiningen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-node-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-sbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-streaming-http-adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
Expand Down

0 comments on commit 03dd09e

Please sign in to comment.