Automated Workflow #10962
This file contains 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
name: Automated Workflow | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
automate-task: | |
runs-on: self-hosted | |
container: | |
image: c4r50nz/selenium-chrome:v20230701 | |
steps: | |
- name: Clone repository | |
run: | | |
rm -rf huma-rime | |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/zhhmn/huma-rime | |
cd huma-rime | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
- name: Run script and capture output | |
id: script | |
run: | | |
cd huma-rime | |
python crawler.py >> $GITHUB_OUTPUT | |
- name: Commit and push if there are changes | |
run: | | |
cd huma-rime | |
git status | |
DATE=$(date +"%Y-%m-%d") | |
git add . | |
git commit --all --verbose -m "Automated update on $DATE" || exit 0 | |
git tag ${{ steps.script.outputs.tag }} | |
git tag | |
git push --tags origin HEAD:master |