-
Notifications
You must be signed in to change notification settings - Fork 82
40 lines (37 loc) · 1.12 KB
/
pullrequest.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
name: Licence-date-verification
on:
pull_request:
branches:
- master
- v*
env:
EXTENSIONS: "c h cpp py go sh mk spec service"
FILES: "configure configure.d/* *Makefile utils/casctl tools/pckgen.d/deb/debian/rules"
jobs:
verify-date:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files_ignore: '.github/**'
- name: List all changed files
run: |
files_to_check=(${{ steps.changed-files.outputs.added_files }})
files_to_check+=(${{ steps.changed-files.outputs.modified_files }})
for file in ${files_to_check[@]}; do
for file_in_list in $FILES; do
if [[ "$file" == $file_in_list ]]; then
.github/verify_header.sh "$file"
continue 2
fi
done
extension=${file##*.}
if [[ "$EXTENSIONS" =~ $extension ]]; then
.github/verify_header.sh "$file"
fi
done