Update README and LaTeX Build File #1
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 and LaTeX Build File | |
on: | |
workflow_dispatch: | |
jobs: | |
update-and-create-pr: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BRANCH: "" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.2' | |
- name: Run update script | |
run: python scripts/update_files.py | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Get default branch | |
run: echo "DEFAULT_BRANCH=$(gh api repos/${{ github.repository }} --jq .default_branch)" >> $GITHUB_ENV | |
- name: Commit changes to a new branch | |
run: | | |
git checkout -b changes/${{ github.run_id }} | |
git add . | |
git commit -m "Apply automated updates" | |
git push -u origin changes/${{ github.run_id }} | |
- name: Create Pull Request | |
run: | | |
gh pr create --base $DEFAULT_BRANCH --head changes/${{ github.run_id }} --title "Specify project URLs and CMake project" --body "Please review the changes applied by the automated script." |