Skip to content

Commit 2c3f385

Browse files
cotticursoragent
andauthored
ci: add changelog-upload workflow and tighten changelog-init permissions (#1123)
Two pieces were missing for the changelog setup to be complete end to end: 1. `changelog-upload.yml` was absent. The existing `changelog-init` (validate + the bespoke upstream-update job) and `changelog-submit` workflows cover the PR lifecycle, but nothing was wired up to regenerate and upload changelog bundles to S3 when PRs land on `main`. That left fork-PR entries in particular without a path to the public bundle — the upload action re-derives them from the merged commit's pull-request record via `docs-builder changelog add --prs <N>`, which only runs on push. This commit adds the reusable workflow call with the three scopes the upload step needs: `contents: read` to check out the commit, `id-token: write` to acquire the AWS OIDC token, and `pull-requests: read` to look up the merged PRs for the pushed SHA so fork entries can be regenerated. Infra prerequisites are already in place: `elastic/elastic-otel-java` is declared in `elastic/docs-infra/modules/aws-github-actions-oidc-roles/repositories.yml` and in `elastic/docs-builder/config/assembler.yml`. 2. `changelog-init.yml` was granting `contents: read` at the workflow level. That worked today because the `upstream-update` job already overrides to `contents: write` + `pull-requests: write` and the `validate` job only needed read access, but the workflow-level permission would silently get inherited by any future job added to this file. Switch to the same pattern adopted in #1118 for `changelog-submit.yml`: workflow-level `permissions: {}` as a least-privilege ceiling, with each job declaring exactly what it needs. The `validate` job now spells out `contents: read` explicitly (the reusable workflow itself declares the same at job level, but a caller-side declaration is required because the workflow-level ceiling propagates into reusable workflow calls). No behaviour change for existing PR runs; the upload path will start firing on the next push to `main`. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7e3d7b4 commit 2c3f385

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/changelog-init.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ on:
1010
- labeled
1111
- unlabeled
1212

13-
permissions:
14-
contents: read
13+
permissions: {}
1514

1615
concurrency:
1716
group: changelog-init-${{ github.event.pull_request.number }}
@@ -54,4 +53,6 @@ jobs:
5453
if: ${{ always() }}
5554
# needs to execute after init-upstream-update
5655
needs: [ upstream-update ]
56+
permissions:
57+
contents: read # reusable workflow checks out the repo to read docs/changelog.yml
5758
uses: elastic/docs-actions/.github/workflows/changelog-validate.yml@v1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: changelog-upload
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions: {}
8+
9+
jobs:
10+
upload:
11+
permissions:
12+
contents: read # checkout the pushed commit
13+
id-token: write # OIDC token for AWS authentication
14+
pull-requests: read # look up merged PRs for the pushed commit so fork-PR entries can be regenerated
15+
uses: elastic/docs-actions/.github/workflows/changelog-upload.yml@v1

0 commit comments

Comments
 (0)