Update Blacklist and Create PR Weekly #13
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 File and Create PR Weekly | |
on: | |
workflow_dispatch: # Manual trigger | |
schedule: | |
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC | |
jobs: | |
update-file: | |
runs-on: ubuntu-latest | |
env: | |
GIT_USER: ${{ secrets.GIT_USER }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
NEW_BRANCH: update-file-${{ github.run_number }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run blocklists-dl.sh | |
run: | | |
chmod +x blocklists-dl.sh | |
./blocklists-dl.sh | |
working-directory: ${{ github.workspace }} | |
- name: Configure Git | |
run: | | |
git config user.name "${GIT_USER}" | |
git config user.email "${GIT_EMAIL}" | |
- name: Create and Checkout New Branch | |
run: | | |
git checkout -b "${NEW_BRANCH}" | |
working-directory: ${{ github.workspace }} | |
- name: Commit and Push Changes | |
run: | | |
git add . | |
git commit -m "Update file via GitHub Action" | |
git push origin "${NEW_BRANCH}" | |
- name: Create Pull Request | |
run: | | |
gh pr create --base main --head "${NEW_BRANCH}" --title "Update file via GitHub Action" --body "This PR was automatically created by a GitHub Action." | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |