ci: add action to create and update badges

This commit is contained in:
Bogdan Popa authored and GitHub committed 2020-07-18 13:48:29 +03:00
1 parent 92224640e6
commit 0706546c75
11 files changed
+799 -236

No files matched your search

+36
View File
@@ -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' }}