Skip to content

Commit 57c76da

Browse files
committed
ci: remove semantic-release-unsquash
@see romap0/semantic-release-unsquash#7
1 parent 2394409 commit 57c76da

File tree

9 files changed

+88
-27
lines changed

9 files changed

+88
-27
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We use [git-flow workflow](https://danielkummer.github.io/git-flow-cheatsheet/)
3939
### Installation
4040
```bash
4141
git clone https://github.com/wp-spaghetti/wp-vite.git
42-
cd wp-env
42+
cd wp-vite
4343
composer install
4444
```
4545

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ updates:
1111
assignees:
1212
- "frugan-dev"
1313
commit-message:
14-
prefix: "deps"
14+
prefix: "chore"
1515
include: "scope"
1616
labels:
1717
- "dependencies"
@@ -27,7 +27,7 @@ updates:
2727
assignees:
2828
- "frugan-dev"
2929
commit-message:
30-
prefix: "ci"
30+
prefix: "chore"
3131
include: "scope"
3232
labels:
3333
- "dependencies"

.github/workflows/auto-merge.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
types:
66
- opened
77
- synchronize
8+
- reopened
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
813

914
jobs:
1015
auto-merge:
@@ -23,26 +28,64 @@ jobs:
2328
pull_number: context.issue.number
2429
});
2530
26-
// Only auto-merge patch updates
31+
// Auto-merge patch and minor updates
2732
const title = pr.data.title.toLowerCase();
28-
const isPatch = title.includes('patch') ||
29-
title.match(/bump .+ from [\d]+\.[\d]+\.[\d]+ to [\d]+\.[\d]+\.[\d]+$/);
33+
const isMinorOrPatch = title.includes('patch') ||
34+
title.includes('minor') ||
35+
title.match(/bump .+ from [\d]+\.[\d]+\.[\d]+ to [\d]+\.[\d]+\.[\d]+$/);
36+
37+
console.log('PR Title:', title);
38+
console.log('Should merge:', isMinorOrPatch);
3039
31-
return { shouldMerge: isPatch };
40+
return { shouldMerge: isMinorOrPatch };
3241
33-
- name: Wait for checks
42+
- name: Auto-approve Dependabot PR
43+
if: fromJSON(steps.pr.outputs.result).shouldMerge
44+
run: |
45+
gh pr review ${{ github.event.pull_request.number }} --approve --body "Auto-approving dependency update"
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Wait for checks (with timeout)
3450
if: fromJSON(steps.pr.outputs.result).shouldMerge
3551
uses: fountainhead/action-wait-for-check@v1.2.0
3652
id: wait-for-checks
3753
with:
3854
token: ${{ secrets.GITHUB_TOKEN }}
3955
checkName: 'Tests (PHP 8.4)'
4056
ref: ${{ github.event.pull_request.head.sha }}
41-
timeoutSeconds: 300
57+
timeoutSeconds: 600
58+
continue-on-error: true
4259

43-
- name: Auto-merge
44-
if: fromJSON(steps.pr.outputs.result).shouldMerge && steps.wait-for-checks.outputs.conclusion == 'success'
60+
- name: Check status and merge
61+
if: fromJSON(steps.pr.outputs.result).shouldMerge
4562
run: |
46-
gh pr merge ${{ github.event.pull_request.number }} --squash --auto
63+
# Get current status
64+
STATUS=$(gh pr status ${{ github.event.pull_request.number }} --json statusCheckRollup --jq '.statusCheckRollup[] | select(.name == "Tests (PHP 8.4)") | .conclusion')
65+
66+
echo "Check status: $STATUS"
67+
68+
if [ "$STATUS" = "SUCCESS" ] || [ "$STATUS" = "NEUTRAL" ]; then
69+
echo "✅ Checks passed, merging PR"
70+
gh pr merge ${{ github.event.pull_request.number }} --squash --auto
71+
elif [ "$STATUS" = "FAILURE" ]; then
72+
echo "❌ Checks failed, not merging"
73+
exit 1
74+
else
75+
echo "⏳ Checks still running or unknown status, enabling auto-merge"
76+
gh pr merge ${{ github.event.pull_request.number }} --squash --auto
77+
fi
4778
env:
4879
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Comment on failure
82+
if: failure()
83+
uses: actions/github-script@v8
84+
with:
85+
script: |
86+
github.rest.issues.createComment({
87+
issue_number: context.issue.number,
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
body: '🤖 Auto-merge failed. Please check the CI status and merge manually if appropriate.'
91+
});

.github/workflows/main.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,17 @@ jobs:
8080

8181
- name: Upload coverage to Codecov
8282
if: matrix.php == '8.4'
83+
continue-on-error: true
8384
uses: codecov/codecov-action@v5
8485
with:
8586
token: ${{ secrets.CODECOV_TOKEN }}
8687
files: ./coverage.xml
87-
fail_ci_if_error: true
88+
fail_ci_if_error: false
8889

8990
# Alternative
9091
- name: Upload coverage to Qlty
9192
if: matrix.php == '8.4'
93+
continue-on-error: true
9294
uses: qltysh/qlty-action/coverage@v2
9395
with:
9496
token: ${{ secrets.QLTY_TOKEN }}
@@ -97,6 +99,7 @@ jobs:
9799
# Alternative
98100
#- name: Upload coverage to Scrutinizer
99101
# if: matrix.php == '8.4'
102+
# continue-on-error: true
100103
# uses: scrutinizer-ci/ocular@v1
101104
# with:
102105
# access-token: ${{ secrets.SCRUTINIZER_ACCESS_TOKEN }}
@@ -163,13 +166,14 @@ jobs:
163166
# - Creates security alerts for repository maintainers
164167
- name: Run Snyk to check for vulnerabilities (PHP)
165168
continue-on-error: true
166-
uses: snyk/actions/php@e2221410bff24446ba09102212d8bc75a567237d
169+
uses: snyk/actions/php@9adf32b1121593767fc3c057af55b55db032dc04
167170
env:
168171
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
169172
with:
170173
args: --severity-threshold=high --sarif-file-output=snyk.sarif --file=composer.lock
171174

172175
- name: Upload Snyk results to GitHub Code Scanning
173-
uses: github/codeql-action/upload-sarif@v3
176+
continue-on-error: true
177+
uses: github/codeql-action/upload-sarif@v4
174178
with:
175179
sarif_file: snyk.sarif

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
id: semantic
4040
with:
4141
# https://github.com/semantic-release/commit-analyzer/issues/65
42+
# https://github.com/romap0/semantic-release-unsquash/issues/7
4243
extra_plugins: |
43-
semantic-release-unsquash@latest
4444
@semantic-release/changelog@latest
4545
@semantic-release/git@latest
4646
conventional-changelog-conventionalcommits@latest

.releaserc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
}
88
],
99
"plugins": [
10-
"semantic-release-unsquash",
1110
[
1211
"@semantic-release/changelog",
1312
{

commitlint.config.mjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
import { RuleConfigSeverity } from '@commitlint/types';
2+
import conventionalConfig from '@commitlint/config-conventional';
3+
14
export default {
25
extends: ['@commitlint/config-conventional'],
36
ignores: [
47
(commit) => /\[skip ci\]/m.test(commit),
58
],
6-
}
9+
rules: {
10+
'body-max-line-length': [RuleConfigSeverity.Error, 'always', 150],
11+
'type-enum': [
12+
RuleConfigSeverity.Error,
13+
'always',
14+
[
15+
...conventionalConfig.rules['type-enum'][RuleConfigSeverity.Error],
16+
'deps', // Add deps for Dependabot
17+
],
18+
],
19+
},
20+
}

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"povils/phpmnd": "^3.6",
4747
"rector/rector": "^1.2|^2.1",
4848
"roave/security-advisories": "dev-latest",
49-
"squizlabs/php_codesniffer": "^3.13",
49+
"squizlabs/php_codesniffer": "^3.13 || ^4.0",
5050
"vimeo/psalm": "^5.26|^6.13"
5151
},
5252
"suggest": {
@@ -74,12 +74,13 @@
7474
"analysis": "@check --tasks=phpstan",
7575
"check": "@php -d max_execution_time=0 -d memory_limit=-1 -f ./vendor/bin/grumphp -- run",
7676
"ci": "@check --no-interaction",
77-
"lint": "@check --tasks=phpcsfixer,phplint,phpstan,rector",
77+
"lint": "@check --tasks=phpcsfixer,phplint,rector",
7878
"quality": "@check --tasks=phpmnd,phpparser",
79+
"rector": "@php -d max_execution_time=0 -d memory_limit=-1 -f ./vendor/bin/rector -- process --ansi --clear-cache",
7980
"security": "@check --tasks=securitychecker_roave",
8081
"test": "@check --tasks=phpunit",
81-
"test:coverage": "vendor/bin/phpunit --coverage-clover=coverage.xml",
82-
"test:integration": "vendor/bin/phpunit --testsuite=integration",
83-
"test:unit": "vendor/bin/phpunit --testsuite=unit"
82+
"test:coverage": "@php -d max_execution_time=0 -d memory_limit=-1 ./vendor/bin/phpunit --coverage-clover=coverage.xml",
83+
"test:integration": "@php -d max_execution_time=0 -d memory_limit=-1 ./vendor/bin/phpunit --testsuite=integration",
84+
"test:unit": "@php -d max_execution_time=0 -d memory_limit=-1 ./vendor/bin/phpunit --testsuite=unit"
8485
}
8586
}

grumphp.yml.dist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ grumphp:
6565

6666
# Psalm - Additional Static Analysis
6767
#FIXME - Temporarily disabled for PHP 8.4 compatibility
68-
# psalm:
69-
# config: psalm.xml.dist
70-
# ignore_patterns: ['vendor']
71-
# threads: 4
68+
#psalm:
69+
# config: psalm.xml.dist
70+
# ignore_patterns: ['vendor']
71+
# threads: 4
7272

7373
# Rector - Automated Refactoring
7474
rector: ~

0 commit comments

Comments
 (0)