-
Notifications
You must be signed in to change notification settings - Fork 300
44 lines (37 loc) · 1.12 KB
/
check-change-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
42
43
44
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check change files
on:
pull_request:
paths:
- '.changes/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check change files end with .md
run: |
for file in .changes/*
do
if [[ ! "$file" =~ \.(md|json)$ ]]; then
echo ".changes directory should only contain files that end with .md"
echo "found an invalid file in .changes directory:"
echo "$file"
exit 1
fi
done
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
changes:
- added|modified: '.changes/*.md'
- name: check
run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }}
if: ${{ steps.filter.outputs.changes == 'true' }}