Skip to content

Commit 41d76a6

Browse files
committed
fix: update branch name validation to include 'develop/test2' in skipped branches
1 parent 0e5274d commit 41d76a6

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: PHP Auto-Fix (Simple)
22

33
on:
4-
push:
5-
branches: [ main, master, develop, 'feature/**', 'fix/**' ]
6-
paths: [ '**.php' ]
74
pull_request:
8-
branches: [ main, master, develop ]
9-
paths: [ '**.php' ]
5+
branches: [main, master, develop]
6+
paths: ['**.php']
107

118
permissions:
129
contents: write
@@ -15,11 +12,11 @@ permissions:
1512
jobs:
1613
auto-fix:
1714
runs-on: ubuntu-latest
18-
19-
# Skip if commit message contains [skip auto-fix] or if it's already an auto-fix commit
15+
16+
# Skip if PR title contains [skip auto-fix] or if it's already an auto-fix commit
2017
if: |
21-
!contains(github.event.head_commit.message, '[skip auto-fix]') &&
22-
!contains(github.event.head_commit.message, 'style: auto-fix code with Rector and ECS')
18+
!contains(github.event.pull_request.title, '[skip auto-fix]') &&
19+
!contains(github.event.pull_request.head.sha, 'style: auto-fix code with Rector and ECS')
2320
2421
steps:
2522
- name: Checkout code
@@ -37,14 +34,10 @@ jobs:
3734
- name: Push changes
3835
if: steps.auto-fix.outputs.changes-made == 'true'
3936
run: |
40-
if [ "${{ github.event_name }}" = "pull_request" ]; then
41-
git push origin HEAD:${{ github.head_ref }}
42-
else
43-
git push origin HEAD:${{ github.ref_name }}
44-
fi
37+
git push origin HEAD:${{ github.head_ref }}
4538
4639
- name: Comment on PR
47-
if: github.event_name == 'pull_request' && steps.auto-fix.outputs.changes-made == 'true'
40+
if: steps.auto-fix.outputs.changes-made == 'true'
4841
uses: actions/github-script@v7
4942
with:
5043
script: |
@@ -53,4 +46,4 @@ jobs:
5346
owner: context.repo.owner,
5447
repo: context.repo.repo,
5548
body: '🤖 **Auto-fix Applied**\n\nRector and ECS have automatically fixed code style and modernization issues.\n\nFiles processed: `${{ steps.auto-fix.outputs.files-processed }}`\n\nPlease review the changes before merging.'
56-
});
49+
});

booster/validate-branch-name.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config = {
1111
/** Branch name (after type and optional ticket) */
1212
namePattern: '[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*',
1313
/** Branches to skip validation */
14-
skipped: ['wip', 'main', 'master', 'develop/test', 'develop/host1', 'develop/host2'],
14+
skipped: ['wip', 'main', 'master', 'develop/test', 'develop/test2', 'develop/host1', 'develop/host2'],
1515
/** Commit footer label to append with ticket (configurable) */
1616
commitFooterLabel: 'Closes',
1717
};

0 commit comments

Comments
 (0)