Workflow file for this run
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 with libraries-bom table | |
# Run this workflow upon published release | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Delete existing 'update-readme-bot' branch | |
run: | | |
git push --delete origin update-readme-bot || echo "Branch doesn't exist, continuing..." | |
git branch -D update-readme-bot || echo "Branch doesn't exist, continuing..." | |
- name: Install dependencies | |
run: pip install pyyaml | |
- name: Update table of artifacts | |
run: | | |
echo "Updating README.md with table of artifacts associated with the latest libraries-bom..." | |
python libraries-bom-table-generation/updateREADMETable.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "Cloud Java Bot" | |
git config --global user.email "cloud-java-bot@google.com" | |
git add README.md | |
git commit -m "chore: update README with release table" | |
git checkout -b update-readme-bot | |
git push origin update-readme-bot | |
- name: Create Pull Request | |
run: | | |
gh pr create --base main --head update-readme-bot --title "chore: Update README with release table" --body "Updating README with the table of artifacts associated with the latest libraries-bom release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} |