Skip to content

Commit 11d1392

Browse files
authored
✨ feature: Update Changelog Changed to Skip if Not Incrementing Version (#79)
1 parent fd73cca commit 11d1392

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/changelog-changed.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ on:
2424
- reopened
2525
- synchronize
2626
- ready_for_review
27+
- labeled
28+
- unlabeled
2729
# Trigger if target branch was changed to a trunk
2830
pull_request_target:
2931
types:
@@ -55,12 +57,27 @@ jobs:
5557
token: ${{ secrets.TJC_TOKEN || secrets.GITHUB_TOKEN }}
5658

5759
# Check for Changes in Changelog
60+
# Or skip if there is no major, minor, or patch label
5861
- name: Check for Changes to Changelog
5962
id: getChanges
60-
uses: tj-actions/[email protected]
63+
if: |
64+
contains(github.event.label.name, 'major') ||
65+
contains(github.event.label.name, 'minor') ||
66+
contains(github.event.label.name, 'patch')
67+
uses: tj-actions/[email protected]
6168
with:
6269
files: CHANGELOG.md
6370

71+
# Report Skipped
72+
- name: Skipped - Version Not Changed
73+
if: |
74+
!contains(github.event.label.name, 'major') &&
75+
!contains(github.event.label.name, 'minor') &&
76+
!contains(github.event.label.name, 'patch')
77+
uses: ./.github/actions/tools/annotation/notice
78+
with:
79+
message: "[Skipped] Version Not Changed"
80+
6481
# Report Success
6582
- name: Success - Changelog Changed
6683
if: steps.getChanges.outputs.any_modified == 'true'
@@ -70,7 +87,7 @@ jobs:
7087

7188
# Report Failure
7289
- name: Failure - Changelog Not Changed
73-
if: steps.getChanges.outputs.any_modified != 'true'
90+
if: steps.getChanges.outputs.any_modified == 'false'
7491
uses: ./.github/actions/tools/exit-code
7592
with:
7693
code: 5

0 commit comments

Comments
 (0)