Update Fancyss Rules #505
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: Update Fancyss Rules | |
on: | |
push: | |
branches: [master] | |
paths: | |
- '.github/workflows/rules.yml' | |
- 'rules/auto_update/*' | |
workflow_dispatch: | |
inputs: | |
FORCE_PUSH: | |
description: 'Force to push' | |
required: true | |
default: true | |
schedule: | |
- cron: '45 19 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run update script | |
run: | | |
sudo apt-get -y install moreutils jq | |
cd rules/auto_update | |
bash update_rules.sh | |
- name: Commit to repo | |
run: | | |
cd $GITHUB_WORKSPACE | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add rules/. | |
git commit -m "Actions Auto Update at $(date +'%Y-%m-%d %H:%M:%S')" | |
git push | |
- name: Delete old workflow runs | |
uses: GitRML/delete-workflow-runs@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
keep_minimum_runs: 7 | |
retain_days: 7 |