Skip to content

Commit 2415174

Browse files
committed
ci(conform): workaround conform bug when on same branch
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
1 parent 5521b68 commit 2415174

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.conform.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
policies:
5+
- type: commit
6+
spec:
7+
dco: true
8+
gpg:
9+
required: true
10+
header:
11+
length: 90
12+
imperative: true
13+
case: lower
14+
invalidLastCharacters: .
15+
body:
16+
required: false
17+
conventional:
18+
types: ["feat", "fix", "build", "chore", "ci", "docs", "perf", "refactor", "revert", "style", "test", "release"]
19+
scopes: [".*"]

.github/workflows/release-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
artifacts-config: .github/artifacts.yml
3030
changelog-creator: git-cliff
3131
release-publisher: github-cli
32-
release.draft: true
32+
release.draft: false
3333
# Skip version bump (no version files to update)
3434
changelog.skipversionbump: true

linters/commits.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ main() {
3232
current_branch=$(git branch --show-current)
3333
default_branch=$(get_default_branch)
3434

35+
# Skip if on the base branch itself (conform can't handle base..HEAD when they're the same)
36+
if [[ "$current_branch" == "$default_branch" ]]; then
37+
print_info "On ${default_branch} - checking HEAD commit only"
38+
if conform enforce 2>/dev/null; then
39+
print_success "Commit health check passed"
40+
return 0
41+
else
42+
print_error "Commit health check failed - check your commit messages"
43+
return 1
44+
fi
45+
fi
46+
3547
if ! has_commits_to_check "$default_branch"; then
3648
print_info "No commits to check on ${current_branch} (compared to ${default_branch})"
3749
return 0

0 commit comments

Comments
 (0)