Skip to content

Commit

Permalink
github-actions: Do not launch actions on fork
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Nov 13, 2023
1 parent 09f87e7 commit ae1d7d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/commentPR.yml
Expand Up @@ -20,7 +20,8 @@ jobs:
add_comment:
runs-on: ubuntu-latest
# we don't want to run workflow if "Check Pull Request" is skipped or cancelled
if: ${{ github.event.workflow_run.event == 'pull_request' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure')}}
# and we don't run this workflow in forks
if: ${{ github.repository == 'eclipse-leshan/leshan' && github.event.workflow_run.event == 'pull_request' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure')}}
strategy:
# Maybe we could create this matrix dynamically :
# See : https://tomasvotruba.com/blog/2020/11/16/how-to-make-dynamic-matrix-in-github-actions/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -27,9 +27,9 @@ env:

jobs:
build:

# don't run this workflow in forks
if: github.repository == 'eclipse-leshan/leshan' && github.event.pull_request.draft == false
name : Code Check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit ae1d7d7

Please sign in to comment.