-
Notifications
You must be signed in to change notification settings - Fork 30
64 lines (52 loc) · 2.35 KB
/
changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Changelog
on:
pull_request:
workflow_dispatch:
workflow_call:
outputs:
release_type:
description: The release type extracted from changelog
value: ${{ jobs.validate_changelog.outputs.release_type }}
no_functional_changes:
description: A boolean signaling that there are no functional changes in the changeset
value: ${{ jobs.check_functional_changes.outputs.no_functional_changes }}
jobs:
check_functional_changes:
runs-on: [ ubuntu-latest ]
outputs:
no_functional_changes: ${{ steps.set_no_functional_changes.outputs.no_functional_changes }}
steps:
- uses: actions/checkout@v4
- name: Make release type available to subsequent jobs # For backwards compatibility, as this workflow is used in other Open Terms Archive repositories
run: |
if grep -q "## Unreleased \[no-release\]" CHANGELOG.md; then
echo "NO_FUNCTIONAL_CHANGES=true" >> $GITHUB_ENV
fi
- name: Print result
id: set_no_functional_changes
run: |
echo "no_functional_changes='${{ env.NO_FUNCTIONAL_CHANGES }}'"
echo "no_functional_changes=${{ env.NO_FUNCTIONAL_CHANGES }}" >> $GITHUB_OUTPUT
validate_changelog:
if: ${{ needs.check_functional_changes.outputs.no_functional_changes != 'true' }}
needs: [ check_functional_changes ]
runs-on: [ ubuntu-latest ]
outputs:
release_type: ${{ steps.set_release_type_output.outputs.release_type }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Print no release assessment result
run: |
echo "Should this run NOT trigger any release: '${{ needs.check_functional_changes.outputs.no_release }}'"
- name: Validate changelog
run: npm run changelog --silent -- --validate
- name: Get release type in changelog
run: echo "RELEASE_TYPE=$(npm run changelog --silent -- --get-release-type)" >> $GITHUB_ENV
- name: Make release type available to subsequent jobs # For backwards compatibility, as this workflow is used in other Open Terms Archive repositories
if: env.RELEASE_TYPE
id: set_release_type_output
run: |
echo "Found release type '${{ env.RELEASE_TYPE }}'"
echo "release_type=${{ env.RELEASE_TYPE }}" >> $GITHUB_OUTPUT