Skip to content

Commit b76bd3a

Browse files
authored
Merge branch 'master' into dev
2 parents 48a7e2a + 082d2fa commit b76bd3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/warn-master-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66

77
jobs:
88
warn-master-branch-pr:
9-
name: Warn about PR from master branch
10-
if: github.event.pull_request.head.ref == 'master'
9+
name: Warn about PR targeting master branch
10+
if: github.event.pull_request.base.ref == 'master'
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Add warning comment
@@ -27,15 +27,15 @@ jobs:
2727
2828
const botComment = comments.data.find(comment =>
2929
comment.user.login === 'github-actions[bot]' &&
30-
comment.body.includes('⚠️ Warning: PR from master branch')
30+
comment.body.includes('⚠️ Warning: PR targeting master branch')
3131
);
3232
3333
if (!botComment) {
3434
await github.rest.issues.createComment({
3535
owner,
3636
repo,
3737
issue_number,
38-
body: "⚠️ **Warning: PR from master branch detected!**\n\nThis pull request appears to be created from the `master` branch. This is typically not recommended because:\n\n1. **Development workflow**: Contributions should usually be made from feature branches or the `dev` branch\n2. **Merge conflicts**: Working directly on master can lead to merge conflicts and complications\n3. **Best practices**: It's safer to create a feature branch for your changes\n\n**Recommended action:**\n- Create a new branch from your current changes: `git checkout -b feature/your-feature-name`\n- Push the new branch and create a new PR from that branch instead\n\nIf this PR is intentional (e.g., hotfix or emergency change), you can ignore this warning.\n\n---\n*This is an automated message. If you believe this warning is incorrect, please contact the maintainers.*"
38+
body: "⚠️ **Warning: PR targeting master branch detected!**\n\n**This PR is targeting `master` but should target `dev` instead.**\n\nAccording to our [CONTRIBUTING.md](https://github.com/HyDE-Project/HyDE/blob/master/CONTRIBUTING.md) and [RELEASE_POLICY.md](https://github.com/HyDE-Project/HyDE/blob/master/RELEASE_POLICY.md):\n\n- **All pull requests must be submitted to the `dev` branch**\n- Changes go through `dev` first for testing before being merged to `master` during release windows\n- **PRs to `master` are only allowed for emergencies**\n\n**Required Action:**\n1. **Rebase this PR to target the `dev` branch instead**\n2. Update the base branch from `master` to `dev`\n3. Follow the [pull request template](https://github.com/HyDE-Project/HyDE/blob/master/.github/PULL_REQUEST_TEMPLATE.md)\n\n**If this is an emergency fix, please add a comment explaining why it needs to target `master` directly.**\n\n---\n*This is an automated message enforcing our contribution workflow.*"
3939
});
4040
console.log('Warning comment added to PR #' + issue_number);
4141
} else {

0 commit comments

Comments
 (0)