-
Notifications
You must be signed in to change notification settings - Fork 6
34 lines (33 loc) · 1.09 KB
/
main.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
name: Update stackoverflow badge
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # every day at midnight
jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- uses: actions/setup-node@v3
with:
node-version: 15
- run: npm ci
- id: update-badge
run: node ./update-badge-script.js
- name: Commit files
if: env.update-badge == 'true'
run: |
git config --local user.email "gihub-bot.tobse.eu"
git config --local user.name "github-james"
git add stackoverflow-badge.svg
git commit -m "🤖 Update Badge" -a
- name: Push changes
if: env.update-badge == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}