This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 2.2 KB
/
check_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
name: Check Changelog
on:
pull_request:
# Sequence of patterns matched against refs/tags
branches:
- main
jobs:
# First job
check_changelog:
name: Check Changelog has been updated
runs-on: ubuntu-latest
steps:
# Standard checkout step
- name: Checkout code
id: git_checkout
uses: actions/checkout@v3
# Get all file changes
- name: Get All Changed Files
id: get_all_changed_files
uses: tj-actions/changed-files@v41
# Get all changed in deploy directory
- name: Get Deployment Changed Files
id: get_deployment_changed_files
uses: tj-actions/changed-files@v41
with:
files: deploy/*
# List all changed files
- name: Check Main Changelog
# Check any files changed AND not just ones in deploy
if: >-
${{
steps.get_all_changed_files.outputs.any_changed == 'true' &&
( steps.get_all_changed_files.outputs.all_changed_files != steps.get_deployment_changed_files.outputs.all_changed_files )
}}
id: check_main_changelog
run: |
for file in ${{ steps.get_all_changed_files.outputs.all_changed_files }}; do
if [[ "${file}" == "Changelog.md" ]]; then
echo "Changelog.md has been modified. Passed main changelog test" 1>&2
exit 0
fi
done
echo "Did not find changelog in list of changed files" 1>&2
exit 1
# Check if deploy changelog has been updated
- name: Check Deploy Changelog
# Check any files changed in deploy
if: >-
${{
steps.get_deployment_changed_files.outputs.any_changed == 'true'
}}
id: check_deploy_changelog
run: |
for file in ${{ steps.get_deployment_changed_files.outputs.all_changed_files }}; do
if [[ "${file}" == "deploy/cttso-ica-to-pieriandx-cdk/Changelog.md" ]]; then
echo "deploy/cttso-ica-to-pieriandx/Changelog.md has been modified. Passed deploy changelog test" 1>&2
exit 0
fi
done
echo "Did not find changelog in list of changed files" 1>&2
exit 1