-
-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (40 loc) · 1.4 KB
/
vulnerability_check.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
name: Vulnerability check and Remove appsettings files
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
remove-appsettings:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Remove appsettings.json files
run: |
find . -type f -name 'appsettings.json' -delete
find . -type f -name 'appsettings.Development.json' -delete
find . -type f -name 'appsettings.Docker.json' -delete
find . -type f -name 'appsettings.docker.json' -delete
find . -type f -name 'appsettings.local.json' -delete
- name: Check for changes
id: git_status
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
- name: Commit changes
if: env.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Remove appsettings.json files"
git remote set-url origin https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/${{ github.repository }}
git push origin HEAD:${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}