forked from wraith-protocol/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (23 loc) · 909 Bytes
/
Copy pathretarget-pr-main.yml
File metadata and controls
26 lines (23 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Retarget PRs against main
on:
pull_request_target:
types: [opened, reopened]
branches: [main]
permissions:
pull-requests: write
issues: write
contents: read
jobs:
retarget:
# Skip release PRs (develop -> main); catch everything else that targets main.
if: github.event.pull_request.head.ref != 'develop'
runs-on: ubuntu-latest
steps:
- name: Retarget to develop and comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR=${{ github.event.pull_request.number }}
REPO=${{ github.repository }}
gh pr edit "$PR" --repo "$REPO" --base develop
gh pr comment "$PR" --repo "$REPO" --body "Auto-retargeted this PR from \`main\` to \`develop\`. Wave PRs merge into \`develop\`; \`main\` is only for release cuts. If you meant to target main deliberately (rare), reply here and we can revert this."