Skip to content

Commit

Permalink
CI: Do not run Docker job on forks (#1915)
Browse files Browse the repository at this point in the history
When a main branch is updated in fork, the workflow runs, but jobs fail because of missing credentials.
The workflow should not run in the first place. Currently, jobs need to be disabled individually.
  • Loading branch information
wenzeslaus committed Oct 3, 2021
1 parent ce465de commit e4fd3ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# stable-alpine, stable-debian, stable-ubuntu
docker-branch-os-matrix:
name: build and push ${{ matrix.os }} for branch
if: startsWith(github.ref, 'refs/heads/')
if: startsWith(github.ref, 'refs/heads/') && github.repository_owner == 'OSGeo'
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
# again for main branch to create latest tag.
docker-main-latest:
name: build and push latest for main branch
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.repository_owner == 'OSGeo'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
# run for releases, take care of release tags
docker-release-os-matrix:
name: build and push release for ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'OSGeo'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down

0 comments on commit e4fd3ae

Please sign in to comment.