Update github_meta.json #1339
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
on: | |
push: | |
branches: | |
- gh-pages | |
schedule: | |
- cron: '15 14 * * *' | |
name: "Update github_meta.json" | |
jobs: | |
update_github_meta: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Update and commit | |
run: | | |
# Update github_meta.json | |
Rscript ./scripts/github_meta.R | |
# detect changes (the code is derived from https://stackoverflow.com/a/3879077) | |
git add ./github_meta.json | |
git update-index --refresh | |
if ! git diff-index --quiet HEAD -- ./github_meta.json; then | |
git config --local user.name 'github-actions[bot]' | |
git config --local user.email 'github-actions[bot]@users.noreply.github.com' | |
git commit -m "Update github_meta.json [skip ci]" | |
git push origin "${{ github.ref }}" | |
else | |
echo "No changes" | |
fi |