Skip to content

.github/workflows/update.yml #2174

.github/workflows/update.yml

.github/workflows/update.yml #2174

Workflow file for this run

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 }}