Build rules #157
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: Build rules | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
paths: | |
- 'scripts/*' | |
- 'templates/*' | |
- 'hosts.txt' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == 'RyuaNerin/only-stackoverflow' && github.event.head_commit.author.email != '[email protected]' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Build | |
run: python scripts/build.py | |
- name: Commit | |
run: | | |
git add only-stackoverflow.txt | |
git add ublacklist.txt | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Build rules" -a | |
- name: Push to protected branch | |
uses: CasperWA/push-protected@v2 | |
with: | |
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }} | |
branch: master | |
unprotect_reviews: true |