Skip to content

Commit

Permalink
Merge pull request #5917 from zhzhuang-zju/jobs
Browse files Browse the repository at this point in the history
prevent some jobs running from forked repository
  • Loading branch information
karmada-bot authored Dec 9, 2024
2 parents 435729a + f9f45b4 commit 96a3a1a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dockerhub-released-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
publish-chart-to-dockerhub:
name: publish to DockerHub
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:
- name: checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dockerhub-released-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ permissions:
jobs:
publish-image-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:
id-token: write # To be able to get OIDC ID token to sign images.
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
needs:
- 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
runs-on: ubuntu-22.04
steps:
Expand Down

0 comments on commit 96a3a1a

Please sign in to comment.