Skip to content

Commit

Permalink
Merge pull request #66 from jefft0/chore/no-workflow-on-forks
Browse files Browse the repository at this point in the history
chore: Don't run workflow jobs on forks
  • Loading branch information
jefft0 authored Apr 24, 2023
2 parents f87e80f + 81f4ee8 commit 19d2147
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:

jobs:
benchmark:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
if: github.event_name == 'DISABLED'
name: Run benchmarks
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/buf-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
# from https://docs.buf.build/ci-cd/github-actions#buf-push
jobs:
buf-release:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dependent-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:

jobs:
check:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
runs-on: ubuntu-latest
steps:
- uses: z0al/[email protected]
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:

jobs:
golangci-lint:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Golangci-lint
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -53,6 +55,8 @@ jobs:
#
# we hope we can remove this job because all the tests are stable 100% of the time
flappy-tests:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Flappy tests (Linux)
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -103,6 +107,8 @@ jobs:
run: make go.flappy-tests

go-tests-on-linux:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Stable tests (Linux)
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -167,6 +173,8 @@ jobs:
fail_ci_if_error: false

go-tests-on-windows:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Stable tests (Windows)
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -211,6 +219,8 @@ jobs:
run: go.exe test ./... -buildmode=exe -timeout=600s -count=1

go-tests-on-macos:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Stable tests (macOS)
runs-on: macos-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:

jobs:
preview:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Release Note Preview
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ on:
- "**/go.sum"
jobs:
gen-go-and-docs:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
if: github.event_name == 'DISABLED' # need to fix it by removing docker for generation
name: Generate go protobuf and docs
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:

jobs:
semantic-release:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
name: Semantic release
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -50,6 +52,8 @@ jobs:
echo "::set-output name=release-version::${{steps.semantic.outputs.release-version}}"
post-semantic-release:
# Check repository owner so that we don't run on a fork.
if: github.repository_owner == 'berty'
needs: semantic-release
#if: needs.semantic-release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 19d2147

Please sign in to comment.