Skip to content

Commit

Permalink
chore: updates validate.yml to run evaluation only on PR from forks
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 13, 2023
1 parent 62c4363 commit b50816b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ name: MegaLinter
on:
push:
pull_request:
branches: main
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
jobs:
test:
name: Evaluate components
if: ${{ github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -28,9 +27,12 @@ jobs:
oscal_model: "compdef"
check_only: true

# Only autofix if the test job fails and the PR is from the same repo
call-autofix:
needs: [test]
if: ${{ always() && contains(needs.*.result, 'failure') }}
if: |
always() && contains(needs.*.result, 'failure')
&& github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
uses: ./.github/workflows/autofix-cd.yml
with:
branch: ${{ github.head_ref }}
Expand Down

0 comments on commit b50816b

Please sign in to comment.