Skip to content

Commit 5b8e295

Browse files
authored
fix: fix java-cloud-bom README update workflow after monorepo migration (#13892)
Fixes b/537369259 ### Context After the monorepo migration (PR #13498), the `java-cloud-bom` repository was moved into the `java-cloud-bom/` subdirectory. The GitHub Actions workflow `.github/workflows/java-cloud-bom-update-readme-table.yaml` was copied over from the split repository without updating its paths or filter triggers. ### Root Causes 1. **Path-Filter Always Skips on Release Events:** On a `release` event, `dorny/paths-filter` compares the release tag commit against `main`. Since release commits are already merged to `main` prior to tagging, the diff is empty, causing `dorny/paths-filter` to evaluate to `false` and skip the `update-readme` job. 2. **Missing Working Directory:** The workflow attempted to run `python libraries-bom-table-generation/updateREADMETable.py` from the repository root, but both the script and target `README.md` are located within the `java-cloud-bom/` subdirectory. ### Fix - **Removed redundant `filter` job:** Replaced it with a direct job condition: ```yaml if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'libraries-bom/') }} ``` This matches the release tag pattern (`libraries-bom/v*`) used by `create_additional_release_tag.yaml` and `java-cloud-bom-release-note-generation.yaml`. - **Configured Working Directory:** Added `defaults.run.working-directory: java-cloud-bom` to the `update-readme` job so all steps execute inside `java-cloud-bom/`.
1 parent d586d07 commit 5b8e295

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/java-cloud-bom-update-readme-table.yaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,21 @@ on:
1313
env:
1414
BUILD_SUBDIR: java-cloud-bom
1515
jobs:
16-
filter:
17-
runs-on: ubuntu-latest
18-
outputs:
19-
library: ${{ steps.filter.outputs.library }}
20-
steps:
21-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
22-
with:
23-
persist-credentials: false
24-
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3
25-
id: filter
26-
with:
27-
filters: |
28-
library:
29-
- 'java-cloud-bom/**'
3016
update-readme:
31-
needs: filter
32-
if: ${{ needs.filter.outputs.library == 'true' }}
17+
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'libraries-bom/') }}
3318
runs-on: ubuntu-latest
19+
defaults:
20+
run:
21+
working-directory: java-cloud-bom
3422
permissions:
3523
contents: write
3624
pull-requests: write
3725
steps:
3826
- name: Check out repository
39-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
27+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
4028
with:
41-
persist-credentials: false
29+
# Explicitly persist credentials so subsequent git push steps can authenticate with origin
30+
persist-credentials: true
4231

4332
- name: Set up Python
4433
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6

0 commit comments

Comments
 (0)