Merge pull request #5917 from zhzhuang-zju/jobs

prevent some jobs running from forked repository
This commit is contained in:
karmada-bot 2024-12-09 18:37:14 +08:00 committed by GitHub
commit 96a3a1a58a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,10 @@ jobs:
publish-chart-to-dockerhub: publish-chart-to-dockerhub:
name: publish to DockerHub name: publish to DockerHub
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
# prevent job running from forked repository, otherwise
# 1. running on the forked repository would fail as missing necessary secret.
# 2. running on the forked repository would use unnecessary GitHub Action time.
if: ${{ github.repository == 'karmada-io/karmada' }}
steps: steps:
- name: checkout code - name: checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@ -8,6 +8,10 @@ permissions:
jobs: jobs:
publish-image-to-dockerhub: publish-image-to-dockerhub:
name: publish to DockerHub name: publish to DockerHub
# prevent job running from forked repository, otherwise
# 1. running on the forked repository would fail as missing necessary secret.
# 2. running on the forked repository would use unnecessary GitHub Action time.
if: ${{ github.repository == 'karmada-io/karmada' }}
permissions: permissions:
id-token: write # To be able to get OIDC ID token to sign images. id-token: write # To be able to get OIDC ID token to sign images.
strategy: strategy:

View File

@ -206,6 +206,10 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
needs: needs:
- release-assests - release-assests
# prevent job running from forked repository, otherwise
# 1. running on the forked repository would use unnecessary GitHub Action time.
# 2. running on the forked repository would open a PR to publish an inaccurate version of karmada in repo kubernetes-sigs/krew-index.
if: ${{ github.repository == 'karmada-io/karmada' }}
name: Update krew-index name: Update krew-index
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps: