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: Auto regenerate homepage | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "**.md" | |
jobs: | |
# Auto regenerate homepage | |
regenerate: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
# Other steps that change files in the repository | |
- name: Execute Python script | |
run: | | |
python homepage.py | |
- name: Commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
if git diff --cached --quiet; then | |
echo "No changes to commit" | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
else | |
git commit -m "feat: auto reg homepage" -a | |
echo "has_changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Pull Request | |
if: ${{ steps.commit.outputs.has_changes == true }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.DEPLOY_GH }} | |
title: "feat: auto reg homepage" | |
commit-message: "feat: auto reg homepage" | |
committer: GitHub <[email protected]> | |
author: GitHub <[email protected]> | |
branch: create-pull-request/patch-auto-reg-homepage | |
base: master | |
labels: | | |
homepage | |
automated pr | |
assignees: DrAugus | |
# Review cannot be requested from pull request author. | |
# reviewers: DrAugus |