Update MKRS #8972
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update MKRS | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */8 * * *' | |
push: | |
branches: | |
- main | |
paths: | |
- mkrs.json | |
jobs: | |
Update-MKRS-Stats: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Trigger = ${{ github.event_name }}" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Install Packages | |
run: | | |
cd update | |
npm install | |
- name: Run Program | |
timeout-minutes: 110 | |
run: | | |
cd update | |
node index.js | |
- name: Check Updates | |
id: git-check | |
run: echo ::set-output name=modified::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi) | |
- name: Commit Updates | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
echo "################### SIZE" | |
ls -hal | |
echo "################### HEAD" | |
head -n100 mkrs.json | |
echo "################### TAIL" | |
tail -n100 mkrs.json | |
git add . | |
git commit -m "updated $(date)" | |
git pull --rebase --strategy-option=ours | |
git push | |
- run: echo "Status = ${{ job.status }}" |