Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Security upgrade golang from 1.17 to 1 #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Publish to GitHub registry on push to main in forks
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
  • Loading branch information
kaovilai committed Mar 22, 2022
commit 1f6b3b614cc0f333c47e08de36f30e8c73110fb1
21 changes: 20 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: write
steps:

- name: Set up Go
@@ -58,13 +60,30 @@ jobs:

# Use the JSON key in secret to login gcr.io
- uses: 'docker/login-action@v1'
id: gcr-login
with:
registry: 'gcr.io' # or REGION.docker.pkg.dev
username: '_json_key'
password: '${{ secrets.GCR_SA_KEY }}'
continue-on-error: true

# Push image to GCR to facilitate some environments that have rate limitation to docker hub, e.g. vSphere.
- name: Publish container image to GCR
if: github.repository == 'vmware-tanzu/velero'
if: github.repository == 'vmware-tanzu/velero' && steps.gcr-login.outcome == 'success'
run: |
REGISTRY=gcr.io/velero-gcp ./hack/docker-push.sh

- name: Login to GitHub registry if it's a fork
if: github.event_name != 'pull_request' && github.repository != 'vmware-tanzu/velero'
id: ghcr-login
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish container image to GitHub registry if it's a fork
if: github.event_name != 'pull_request' && github.repository != 'vmware-tanzu/velero' && steps.ghcr-login.outcome == 'success'
run: |
REGISTRY=ghcr.io/${{ github.actor }} ./hack/docker-push.sh