-
-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (72 loc) · 2.55 KB
/
run.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: 'update graph.html'
on:
pull_request:
schedule:
- cron: '0 0 * * 6'
#- cron: '24 17 11 12 1'
workflow_dispatch:
jobs:
build_and_test:
name: '${{ matrix.os }}: run'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_WORKSPACES }}
path: getactionusage
- uses: actions/checkout@v3
name: Fetch the web site repo to update.
with:
token: ${{ secrets.PAT_WORKSPACES }}
repository: lukka/lukka.github.io
path: lukkagithubio
ref: main
- uses: actions/setup-node@v4
with:
node-version: '20.x'
#- run: |
# npm install
# npm run build/pack
- uses: ./getactionusage
name: Scan GitHub public repositories
env:
GITHUB_TOKEN: ${{ secrets.PAT_WORKSPACES }}
- uses: actions/upload-artifact@v3
with:
name: results
path: ${{ github.workspace }}/getactionusage/graph/action-usage-db.json
- name: Check for modified files
id: git-check
run: echo "modified=$(if [ -n "$(cd getactionusage && git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
- name: Commit DB content and update CRON job
if: steps.git-check.outputs.modified == 'true'
run: |
cd getactionusage
git config --global user.name 'Luca'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.PAT_WORKSPACES }}@github.com/${{ github.repository }}
git add -A
git add -f ./graph/action-usage-db.json
git status
git commit -m "Automated commit for DB JSON file and updated CRON job"
git push
- name: Publish updated network graph
if: steps.git-check.outputs.modified == 'true'
shell: bash
run: |
cd lukkagithubio
git config --global user.name 'Luca'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.PAT_WORKSPACES }}@github.com/lukka/lukka.github.io
mkdir -pv ./graph/
cp ../getactionusage/graph/action-usage-db.json ./graph
cp ../getactionusage/graph/graph.html ./graph
git add -f ./graph/action-usage-db.json
git add -f ./graph/graph.html
git status
git commit -m "Automated commit for publishing updated graph web page"
git push