-
Notifications
You must be signed in to change notification settings - Fork 201
47 lines (39 loc) · 1.34 KB
/
readme.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
36
37
38
39
40
41
42
43
44
45
46
47
name: Sync README.md
on:
workflow_dispatch:
schedule:
- cron: '0 16 * * *'
jobs:
Sync:
name: Sync README.md
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Compare with Gitlab
run: |
GITLAB=$(wget -qO- https://gitlab.com/fscarmen/warp/-/raw/main/README.md | md5sum)
GITHUB=$(wget -qO- https://raw.githubusercontent.com/fscarmen/warp-sh/main/README.md | md5sum)
if [ "$GITLAB" != "$GITHUB" ]; then
wget -O README.md https://gitlab.com/fscarmen/warp/-/raw/main/README.md
git checkout --orphan tmp_work
git branch -d ${GITHUB_REF#refs/heads/}
echo "DATE=$(date "+%Y/%m/%d %H:%M:%S")" >> $GITHUB_ENV
fi
- name: Update README.md
if: ${{ env.DATE != '' }}
uses: stefanzweifel/[email protected]
with:
commit_message: Auto renew by Github Actions, ${{ env.DATE }}
create_branch: true
branch: main
push_options: --force
- name: Delete old workflow runs
uses: MajorScruffy/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository: ${{ github.repository }}
older-than-seconds: 3600