-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.8 KB
/
updateHeader.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update Header
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: true
files: |
*.java
# !*.md
# test_directory
# **/*.sql
- name: Setting up the git user
run: |
git config --global user.name 'Muhammad Khuzaima Umair'
git config --global user.email 'mkhuzaima@users.noreply.github.com'
- name: Run for changed java files
run: |
for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do
echo "$file was changed"
python .github/workflows/updateHeader.py $file
# create commit
git commit -am "Formatted $file" || echo "nothing to commit"
done
git push || echo "There is nothing to push"
# - name: Run step if only the files listed above change
# if: steps.changed-files-specific.outputs.only_changed == 'true'
# run: |
# echo "Only files listed above have changed."
# - name: Run step if any of the listed files above is deleted
# if: steps.changed-files-specific.outputs.any_deleted == 'true'
# run: |
# for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
# echo "$file was deleted"
# done
# - name: Run step if all listed files above have been deleted
# if: steps.changed-files-specific.outputs.only_deleted == 'true'
# run: |
# for file in ${{ steps.changed-files-specific.outputs.deleted_files }}; do
# echo "$file was deleted"
# done