-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.2 KB
/
header.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
name: Header_Check
on:
pull_request:
branches:
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Check for and Add Headers
run: |
python ./.github/workflows/script.py
- name: Git Diff
id: git_diff
run: |
FILESCHANGED=$(git diff --quiet || echo "TRUE")
echo "FILESCHANGED=$FILESCHANGED" >> $GITHUB_ENV
- name: Commit and push files
if: env.FILESCHANGED == 'TRUE'
run: |
echo "Files have been changed"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Add missing document markings" -a
- name: Push changes
if: env.FILESCHANGED == 'TRUE'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}