From a5fb4bbd9980d7ec8f78629d76761dfeb29cfb20 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Wed, 18 Aug 2021 15:04:01 -0700 Subject: [PATCH] Make CI work with PRs from forks (I hope) --- .github/workflows/link-checker-pr.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/link-checker-pr.yml b/.github/workflows/link-checker-pr.yml index 07924019a0..4a6da29864 100644 --- a/.github/workflows/link-checker-pr.yml +++ b/.github/workflows/link-checker-pr.yml @@ -1,7 +1,13 @@ name: Link Checker (PR Build) on: - pull_request: + # Note: this job runs with in-repo permissions so it can comment and commit + # on stuff in the repo even when the PR is coming from a PR. This means that + # it can, potentially, wreak havoc on the repository by running arbitrary + # code. Be sure to ONLY approve job runs AFTER you have confirmed that the + # commits in question do not contain malicious or suspicious code (especially + # to the .sh or .py files in the tool/ directory.) + pull_request_target: types: [opened, edited, synchronize] jobs: @@ -11,6 +17,10 @@ jobs: steps: - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: