-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (32 loc) · 915 Bytes
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
on:
schedule:
# Once every day.
- cron: "0 0 * * *"
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 "90636620+andreubot@users.noreply.github.com"
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 }}