-
Notifications
You must be signed in to change notification settings - Fork 246
73 lines (63 loc) · 1.91 KB
/
parse-submission.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
name: Parse Submission
on:
push:
branches:
- main
jobs:
check-commit-message:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.RBD_GITHUB_TOKEN }}
- name: Check commit message
id: check
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MESSAGE" == "Update repository stars" || "$COMMIT_MESSAGE" == "Update app info" ]]; then
echo "skip=true" >> $GITHUB_ENV
echo "::set-output name=skip::true"
else
echo "skip=false" >> $GITHUB_ENV
echo "::set-output name=skip::false"
fi
update-app-info:
if: needs.check-commit-message.outputs.skip == 'false'
runs-on: ubuntu-latest
needs: check-commit-message
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.RBD_GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run script
run: node parse-app-info.js
- name: Commit and push changes
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 "Update app info"
git push
env:
GITHUB_TOKEN: ${{ secrets.RBD_GITHUB_TOKEN }}
update-stats:
if: needs.check-commit-message.outputs.skip == 'false'
runs-on: ubuntu-latest
needs: update-app-info
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get repository stats
id: get_stats
run: |
# Add your script to get repository stats here