Skip to content

Commit b668952

Browse files
authored
Merge pull request #5970 from tdonohue/port_5967_to_9x
[Port dspace-9_x] [GitHub Actions] Fix our broken `port_pr` action after the upgrade to `checkout@v7` (Angular version)
2 parents 8bd9b15 + af2048b commit b668952

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/port_merged_pull_request.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,22 @@ permissions:
1818

1919
jobs:
2020
port_pr:
21-
runs-on: ubuntu-latest
22-
# Don't run on closed *unmerged* pull requests
23-
if: github.event.pull_request.merged
21+
runs-on: ubuntu-slim
22+
# Only run on MERGED pull requests,
23+
# and only run if the merged PR has a label that starts with "port to"
24+
if: >
25+
github.event.pull_request.merged &&
26+
contains(toJSON(github.event.pull_request.labels.*.name), '"port to ')
2427
steps:
2528
# Checkout code
2629
- uses: actions/checkout@v7
30+
with:
31+
# When using 'pull_request_target' (see above), this 'checkout' step will always fail because it
32+
# may make the codebase vulnerable to "pwn requests" via the user-created PR.
33+
# See https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
34+
# However, we are allowing this unsafe checkout because (1) it's required to backport the PR, and
35+
# (2) this job only runs when a PR is MERGED, and merger only happens after a thorough review of the PR.
36+
allow-unsafe-pr-checkout: true
2737
# Port PR to other branch (ONLY if labeled with "port to")
2838
# See https://github.com/korthout/backport-action
2939
- name: Create backport pull requests

0 commit comments

Comments
 (0)