Skip to content

Commit

Permalink
Auto renew by Github Actions, 2024/09/24 16:25:47
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarmen authored and github-actions[bot] committed Sep 24, 2024
0 parents commit 3d2f8f5
Show file tree
Hide file tree
Showing 2 changed files with 730 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
Loading

0 comments on commit 3d2f8f5

Please sign in to comment.