-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.18 KB
/
repository-info.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
name: Repository Info
on:
push:
branches:
- main
paths-ignore:
- "app/data/repository/repository-info.json"
- "report.txt"
jobs:
get-repository-info:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14
- name: Install dependencies
run: npm install
- name: Run script to get repository info
run: |
node app/workflow/get-repository-info.js
env:
GITHUB_REPOSITORY: ${{ secrets.SUPER_SECRET }}
- name: Check for changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add app/data/repository/repository-info.json
if git diff --cached --quiet; then
echo "No changes detected, skipping commit and push."
exit 0
fi
- name: Commit and push changes
run: |
git pull origin main --ff-only
git commit -m "Update repository-info.json"
git push origin HEAD:${{ github.ref }}