-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (36 loc) · 1.58 KB
/
check-changelog-files.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
name: Check version bump and changelog files
on:
push
jobs:
check-version-bump:
runs-on: ubuntu-latest
name: Verify whether any updates were made to the modules' versions, and if they were, examine the changelog files for the respective modules
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: packages/**/package.json
- name: Build matrix input
id: build-matrix
if: ${{ steps.changed-files.outputs.all_changed_files }} != '[]'
run: |
set +e
modules_list=()
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./bin/check-version-bump.sh ./"$file"
# check-version-bump exits with 0 if it detects a bump, otherwise with 1
if [ $? != "1" ] && [[ ! " ${modules_list[*]} " =~ " ${file} " ]]; then
version="$(cat ${{ file }}/package.json | jq -r '.version')"
module_list+=("{\"name\": \"$file\", \"version\": \"$version\"}")
fi
done
jsonString="$(jq --compact-output --null-input '$ARGS.positional' --args -- "${modules_list[@]}")"
echo 'miko'
echo $jsonString
echo "modules=$jsonString" >> $GITHUB_OUTPUT
# - name: Check changelog files
# if: ${{ steps.get-modules-with-increased-version.outputs.modules != '' }}
# run: |
# kotlinc -script .github/scripts/CheckChangelogs.main.kts ${{ steps.get-modules-with-increased-version.outputs.modules}}