.github/workflows/update.yml #2174
This file contains hidden or 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: | |
| schedule: | |
| # Once every day. | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| update-csswg: | |
| name: "Update CSSWG drafts" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| token: ${{ secrets.BOT_GH_TOKEN }} | |
| submodules: true | |
| - name: Update and commit | |
| run: | | |
| set -e | |
| git config user.name "andreubot" | |
| git config user.email "[email protected]" | |
| cd csswg-drafts | |
| OLD_SHA="$(git rev-parse HEAD)" | |
| git fetch | |
| git reset --hard origin/main | |
| NEW_SHA="$(git rev-parse HEAD)" | |
| cd .. | |
| if [ "$OLD_SHA" != "$NEW_SHA" ]; then | |
| git add csswg-drafts | |
| git commit -m "Update to w3c/csswg-drafts@$NEW_SHA" | |
| git push | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.BOT_GH_TOKEN }} |