43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
name: cherry-picks-warn
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
branches:
|
|
- branch-[0-9]+.[0-9]+
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
notify:
|
|
runs-on: ubuntu-slim
|
|
timeout-minutes: 5
|
|
permissions:
|
|
pull-requests: write # to post a comment on the PR
|
|
steps:
|
|
- env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR: ${{ github.event.pull_request.number }}
|
|
REPO: ${{ github.repository }}
|
|
run: |
|
|
gh pr comment "$PR" --repo "$REPO" --body '# ⚠️ Important: Cherry-Pick Merge Instructions
|
|
|
|
**If you are cherry-picking commits to a release branch, "Rebase and merge" must be used when merging this PR, NOT "Squash and merge".**
|
|
|
|
### Why "Squash and merge" causes problems:
|
|
|
|
- It makes reverting individual commits impossible
|
|
- It removes the association between original and cherry-picked commits
|
|
- It makes it difficult to track which commits have been cherry-picked
|
|
- It causes incorrect results in:
|
|
- [`update-release-labels.yml`](.github/workflows/update-release-labels.yml)
|
|
- [`update_changelog.py`](dev/update_changelog.py)
|
|
- [`check_patch_prs.py`](dev/check_patch_prs.py)
|
|
|
|
If "Rebase and merge" is disabled, follow [Configuring commit rebasing for pull requests](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests) to enable it.'
|