Skip to content

Commit ebdcc80

Browse files
authored
Merge pull request #463 from devsecopsmaturitymodel/fix/ci
test new workflow
2 parents f66ca03 + 3528cfb commit ebdcc80

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ jobs:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
- name: Get Semantic Release Version
3030
id: get-version
31-
run: echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')"
31+
run: |
32+
VERSION=$(npx semantic-release --dry-run 2>&1 | grep -o 'Release note for version [0-9]\+\.[0-9]\+\.[0-9]\+' | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
33+
if [ -z "$VERSION" ]; then
34+
echo "❌ No version could be detected by semantic-release"
35+
echo "This usually means no commits warrant a release (no feat/fix/breaking changes)"
36+
exit 1
37+
fi
38+
echo "version=$VERSION" >> $GITHUB_OUTPUT
3239
3340
- name: show version
3441
run: |

.releaserc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"preset": "angular",
88
"releaseRules": [
99
{"breaking": true, "release": "minor"},
10-
{"tag": "Breaking", "release": "minor"}
10+
{"tag": "Breaking", "release": "minor"},
11+
{"type": "merge", "release": "patch"},
12+
{"subject": "*Merge pull request*", "release": "patch"}
1113
]
1214
}
1315
],

0 commit comments

Comments
 (0)