Update README #140
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 README | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update-readme: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pathlib | |
- name: Update README | |
run: | | |
python build_readme.py | |
- name: Check if README has changed | |
id: check_readme | |
run: | | |
if git diff --quiet README.md; then | |
echo "README has not changed" | |
echo "::set-output name=changed::false" | |
else | |
echo "README has changed" | |
echo "::set-output name=changed::true" | |
fi | |
- name: Generate datetime string for PR title | |
id: datetime | |
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M')" | |
- name: Commit and push changes to a new branch | |
if: steps.check_readme.outputs.changed == 'true' | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "pseudoyu" | |
git checkout -b update-readme-${{ steps.datetime.outputs.datetime }} | |
git add README.md | |
git commit -m "doc: update supported network and worker in README.md" | |
git push origin update-readme-${{ steps.datetime.outputs.datetime }} | |
- name: Create Pull Request | |
if: steps.check_readme.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "doc: update supported network and worker in README.md" | |
branch: update-readme-${{ steps.datetime.outputs.datetime }} | |
title: "ci(README.md): update supported network and worker (${{ steps.datetime.outputs.datetime }})" | |
body: "This PR updates the README.md file with the latest supported network and worker information." | |
base: main |