-
Notifications
You must be signed in to change notification settings - Fork 24
49 lines (40 loc) · 1.56 KB
/
update-readme-table.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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@v5
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 }}