mirror of
https://github.com/tiennm99/awesome-advent-of-code.git
synced 2026-10-15 02:16:24 +00:00
ci: add action to create and update badges
This commit is contained in:
1 parent
92224640e6
commit
0706546c75
11 files changed
+799
-236
No files matched your search
@@ -0,0 +1,36 @@
|
||||
name: Update AoC badge
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * 1-11 1'
|
||||
- cron: '0 0 * 12 *'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install packages
|
||||
run: yarn
|
||||
working-directory: ./.github/actions/update-badge
|
||||
|
||||
- name: Use local action
|
||||
uses: ./.github/actions/update-badge
|
||||
with:
|
||||
ghToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
inputFile: README.md
|
||||
outputFile: README.md
|
||||
|
||||
- name: Git commit and push
|
||||
run: |
|
||||
git config user.email 'actions@github.com'
|
||||
git config user.name 'github-actions'
|
||||
git add README.md
|
||||
git commit -m 'update badges'
|
||||
git push origin HEAD:${{ contains(github.event_name, 'pull_request') && github.head_ref || 'master' }}
|
||||
Reference in new issue
Block a user