Skip to content

Commit

Permalink
Merge pull request #8 from codecov/feature/self-hosted-fork
Browse files Browse the repository at this point in the history
Don't do protected thins on forks for self-hosted
  • Loading branch information
trent-codecov authored Nov 14, 2023
2 parents 87826aa + fefd287 commit 9a4985b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v4

- id: "auth"
if: github.repository_owner == 'codecov' && inputs.cache_requirements
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' && inputs.cache_requirements }}
name: "Authenticate to Google Cloud"
uses: "google-github-actions/[email protected]"
with:
Expand All @@ -37,7 +37,7 @@ jobs:
service_account: ${{ secrets.CODECOV_GCP_WIDSA }}

- name: Docker configuration
if: github.repository_owner == 'codecov' && inputs.cache_requirements
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' && inputs.cache_requirements }}
run: |-
echo ${{steps.auth.outputs.access_token}} | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
self-hosted:
name: Push Self Hosted Image
needs: [ build-self-hosted ]
if: inputs.push_rolling == true && github.repository_owner == 'codecov'
if: inputs.push_rolling == true && github.repository_owner == 'codecov' && !github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
environment: self-hosted
steps:
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
self-hosted-release:
name: Push Self Hosted Release Image
needs: [ build-self-hosted ]
if: inputs.push_release == true && github.repository_owner == 'codecov'
if: inputs.push_release == true && github.repository_owner == 'codecov' && !github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
environment: self-hosted
steps:
Expand Down

0 comments on commit 9a4985b

Please sign in to comment.