mirror of
https://github.com/silenty4ng/uv-k5-firmware-chinese-lts
synced 2025-01-15 14:54:40 +00:00
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
|
name: File header
|
||
|
|
||
|
on:
|
||
|
pull_request:
|
||
|
branches: [ develop ]
|
||
|
paths:
|
||
|
- 'CMSIS/Core/**'
|
||
|
- 'CMSIS/Core_A/**'
|
||
|
- 'CMSIS/RTOS2/Include/**'
|
||
|
- 'CMSIS/RTOS2/Source/**'
|
||
|
- 'Device/**'
|
||
|
|
||
|
permissions:
|
||
|
contents: read
|
||
|
pull-requests: write
|
||
|
|
||
|
jobs:
|
||
|
check:
|
||
|
name: Check file header
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Calculate depth
|
||
|
id: depth
|
||
|
run: |
|
||
|
echo ::set-output name=GIT_COMMITS::$((${{ github.event.pull_request.commits }} + 1))
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v2
|
||
|
with:
|
||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||
|
fetch-depth: ${{ steps.depth.outputs.GIT_COMMITS }}
|
||
|
- id: files
|
||
|
uses: jitterbit/get-changed-files@v1
|
||
|
- name: Check changed files
|
||
|
run: |
|
||
|
echo "GIT_COMMITS=${{ steps.depth.outputs.GIT_COMMITS }}"
|
||
|
echo "::add-matcher::.github/fileheader.json"
|
||
|
RC=0
|
||
|
for changed_file in ${{ steps.files.outputs.added_modified }}; do
|
||
|
./CMSIS/Utilities/check_header.sh -v -b HEAD~${{ github.event.pull_request.commits }} ${changed_file} || RC=1
|
||
|
done
|
||
|
echo "::remove-matcher owner=fileheader::"
|
||
|
exit $RC
|