Merge pull request #5917 from zhzhuang-zju/jobs
prevent some jobs running from forked repository
This commit is contained in:
commit
96a3a1a58a
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue