diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7277c2b54c..bcba3534dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,21 @@ jobs: npm install-clean npm test npm run build + - name: delete branch if generated by `push-pr` workflow (used to generate builds of PRs from forks) + if: "github.event_name == 'push' && github.ref_type == 'branch' && startsWith(github.ref, 'pr')" + run: | + git push origin --delete ${{ github.ref }} + - name: on PRs from forks, comment on PR with link to 'push-pr' workflow for @guardian/digital-cms members + if: "github.event.pull_request.head.repo.fork" + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Hey @guardian/digital-cms, this PR is from a fork. Brilliant that people are contributing from outside the organisation but please check there's nothing malicious/problematic... when you're happy and you need a deployable, run the [push-pr workflow]("").' + }) - uses: aws-actions/configure-aws-credentials@v4 if: "! github.event.pull_request.head.repo.fork" with: