diff --git a/.github/workflows/hero-check.yml b/.github/workflows/hero-check.yml index 40e0363..267775d 100644 --- a/.github/workflows/hero-check.yml +++ b/.github/workflows/hero-check.yml @@ -1,7 +1,7 @@ name: Hero Check on: - pull_request: + pull_request_target: branches: [ "main" ] paths: - 'open-source-heroes.md' @@ -10,27 +10,31 @@ jobs: check-for-hero: runs-on: ubuntu-latest permissions: + issues: write pull-requests: write steps: - name: Checkout Target uses: actions/checkout@v4 with: - repository: jordangov/defcon-poc + repository: ${{ github.event.pull_request.base.repo.full_name }} ref: main path: target - name: Checkout Source uses: actions/checkout@v4 with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} path: source - name: Check Submission id: check_sub run: >- + echo "Checking diff from ${{ github.event.pull_request.head.ref }} on ${{ github.event.pull_request.head.repo.full_name }}..."; SUBMISSION=`(diff target/open-source-heroes.md source/open-source-heroes.md || true) | awk '/\* @${{github.actor}}/{ print $4 }'`; - CHECK=`echo -n "${{github.actor}}-${{secrets.SALT}}" | openssl dgst -${{secrets.ALGO}} | awk '/[a-z0-9]+/{ print $2 }'`; - echo "Confirming submission ($SUBMISSION) equals check..."; + CHECK=`echo -n "${{github.actor}}-${{ secrets.SALT }}" | openssl dgst -${{ secrets.ALGO }} | awk '/[a-z0-9]+/{ print $2 }'`; + echo "Confirming submission ($SUBMISSION) for ${{github.actor}} equals check..."; if [[ "$SUBMISSION" = "$CHECK" ]]; then echo "Submissions match"