-
Notifications
You must be signed in to change notification settings - Fork 2
Add bundle action and reusable workflow #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cotti
wants to merge
26
commits into
main
Choose a base branch
from
feature/bundle_action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
cb3c68c
Add bundle action and reusable workflow
cotti fa8354f
Merge branch 'main' into feature/bundle_action
cotti c31000b
Add README
cotti 4de3e84
Split action into bundle generation and PR submission. Readjusted nam…
cotti 6bfcfd9
Merge remote-tracking branch 'origin/main' into feature/bundle_action
cotti e43c658
Security fixes
cotti f86c77c
Use --force-with-lease instead of -f
cotti 1df7f08
Merge remote-tracking branch 'origin' into feature/bundle_action
cotti 06f4322
Add --prs support
cotti 803d979
Add support for profile-based bundling
cotti 7982c5f
Use env vars for docker run
cotti 2e773dc
Validate paths
cotti 0e5b77c
Update README
cotti 3f83498
Merge branch 'main' into feature/bundle_action
cotti 2d8fd32
Merge branch 'main' into feature/bundle_action
cotti 687861d
Adjust action to use docs-builder changelog bundle --plan
cotti f7750eb
Set outputs instead
cotti 20bacab
Update README
cotti ab2fcc3
Merge branch 'main' into feature/bundle_action
cotti b2e6a14
Fix README
cotti 5bc0760
Harden input validation
cotti 40e06dd
Pin docs-builder version using attestation-verify
cotti c21dbdc
Add domain allowlist for report URLs
cotti 07c29bc
revert tackling ssrf in the action
cotti 974256d
Merge branch 'main' into feature/bundle_action
cotti 8a22206
Update README
cotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: Changelog bundle | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| config: | ||
| description: 'Path to changelog.yml configuration file' | ||
| type: string | ||
| default: 'docs/changelog.yml' | ||
| profile: | ||
| description: > | ||
| Bundle profile name from bundle.profiles in changelog.yml. | ||
| Mutually exclusive with release-version and prs. | ||
| type: string | ||
| version: | ||
| description: > | ||
| Version string for profile mode (e.g. 9.2.0). Only valid with profile. | ||
| type: string | ||
| release-version: | ||
| description: > | ||
| GitHub release tag used as the PR filter source (e.g. v9.2.0). | ||
| Mutually exclusive with profile, report, and prs. | ||
| type: string | ||
| report: | ||
| description: > | ||
| Buildkite promotion report HTTPS URL or local file path. | ||
| Mutually exclusive with release-version and prs in option mode. | ||
| In profile mode, passed as a positional argument. | ||
| type: string | ||
| prs: | ||
| description: > | ||
| Comma-separated PR URLs or numbers, or a path to a newline-delimited file. | ||
| Mutually exclusive with profile, release-version, and report. | ||
| type: string | ||
| output: | ||
| description: > | ||
| Output file path for the bundle (e.g. docs/releases/v9.2.0.yaml). | ||
| Optional. When not provided, the path is determined by the config | ||
| (bundle.output_directory) and discovered automatically after generation. | ||
| type: string | ||
| base-branch: | ||
| description: 'Base branch for the pull request (defaults to repository default branch)' | ||
| type: string | ||
| repo: | ||
| description: 'GitHub repository name; falls back to bundle.repo in changelog.yml' | ||
| type: string | ||
| owner: | ||
| description: 'GitHub repository owner; falls back to bundle.owner in changelog.yml' | ||
| type: string | ||
| docs-builder-version: | ||
| description: > | ||
| docs-builder version to use (e.g. 0.1.100, latest, edge). | ||
| Non-edge versions are attestation-verified by the setup action. | ||
| type: string | ||
| default: 'edge' | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: changelog-bundle-${{ inputs.output || inputs.profile }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
cotti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| generate: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: read | ||
| outputs: | ||
| output: ${{ steps.bundle.outputs.output }} | ||
| steps: | ||
| - id: bundle | ||
| uses: elastic/docs-actions/changelog/bundle-create@v1 | ||
| with: | ||
| config: ${{ inputs.config }} | ||
| profile: ${{ inputs.profile }} | ||
| version: ${{ inputs.version }} | ||
| release-version: ${{ inputs.release-version }} | ||
| report: ${{ inputs.report }} | ||
| prs: ${{ inputs.prs }} | ||
| output: ${{ inputs.output }} | ||
| repo: ${{ inputs.repo }} | ||
| owner: ${{ inputs.owner }} | ||
| docs-builder-version: ${{ inputs.docs-builder-version }} | ||
| github-token: ${{ github.token }} | ||
|
|
||
| create-pr: | ||
| needs: generate | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: elastic/docs-actions/changelog/bundle-pr@v1 | ||
| with: | ||
| output: ${{ needs.generate.outputs.output }} | ||
| base-branch: ${{ inputs.base-branch }} | ||
| github-token: ${{ github.token }} | ||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <!-- Generated by https://github.com/reakaleek/gh-action-readme --> | ||
| # <!--name-->Changelog bundle create<!--/name--> | ||
| <!--description--> | ||
| Checks out the repository, runs docs-builder changelog bundle in Docker to generate a fully-resolved bundle file, and uploads the result as an artifact. Supports option-based filtering (release-version, report, prs) and profile-based bundling. Uses --network none where possible. | ||
| <!--/description--> | ||
|
|
||
| ## Inputs | ||
| <!--inputs--> | ||
| | Name | Description | Required | Default | | ||
| |------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-----------------------| | ||
| | `config` | Path to changelog.yml configuration file | `false` | `docs/changelog.yml` | | ||
| | `profile` | Bundle profile name from bundle.profiles in changelog.yml. Mutually exclusive with release-version and prs. When set, all paths and filters come from the config.<br> | `false` | ` ` | | ||
| | `version` | Version string for profile mode (e.g. 9.2.0, 2026-03). Used for {version} substitution in profile patterns. Only valid with profile.<br> | `false` | ` ` | | ||
| | `release-version` | GitHub release tag used as the PR filter source (e.g. v9.2.0). Mutually exclusive with profile, report, and prs.<br> | `false` | ` ` | | ||
| | `report` | Buildkite promotion report URL or local file path used as the PR filter source. In option mode, mutually exclusive with release-version and prs. In profile mode, passed as a positional argument. Local paths must be relative to the repo root.<br> | `false` | ` ` | | ||
| | `prs` | Comma-separated PR URLs or numbers, or a path to a newline-delimited file. Mutually exclusive with profile, release-version, and report. Bare numbers require repo/owner to be set in changelog.yml or inputs.<br> | `false` | ` ` | | ||
| | `output` | Output file path for the bundle, relative to the repo root. Optional in both modes. When not provided, docs-builder writes to the path determined by the config (bundle.output_directory) and the plan resolves the generated file path automatically.<br> | `false` | ` ` | | ||
| | `repo` | GitHub repository name. Falls back to bundle.repo in changelog.yml.<br> | `false` | ` ` | | ||
| | `owner` | GitHub repository owner. Falls back to bundle.owner in changelog.yml, then to elastic.<br> | `false` | ` ` | | ||
| | `docs-builder-version` | docs-builder version to use (e.g. 0.1.100, latest, edge). Non-edge versions are attestation-verified by the setup action.<br> | `false` | `edge` | | ||
| | `artifact-name` | Name for the uploaded artifact (must match bundle-pr artifact-name) | `false` | `changelog-bundle` | | ||
| | `github-token` | GitHub token (needed for release-version and source: github_release profiles) | `false` | `${{ github.token }}` | | ||
| <!--/inputs--> | ||
|
|
||
| ## Outputs | ||
| <!--outputs--> | ||
| | Name | Description | | ||
| |----------|------------------------------------------| | ||
| | `output` | Resolved output file path for the bundle | | ||
| <!--/outputs--> | ||
|
|
||
| ## Usage | ||
| <!--usage action="elastic/docs-actions/changelog/bundle-create" version="v1"--> | ||
|
|
||
| Option mode: | ||
| ```yaml | ||
| steps: | ||
| - uses: elastic/docs-actions/changelog/bundle-create@v1 | ||
| with: | ||
| release-version: v9.2.0 | ||
| output: docs/releases/v9.2.0.yaml | ||
| ``` | ||
|
|
||
| Profile mode: | ||
| ```yaml | ||
| steps: | ||
| - uses: elastic/docs-actions/changelog/bundle-create@v1 | ||
| with: | ||
| profile: elasticsearch-release | ||
| version: 9.2.0 | ||
| ``` | ||
| <!--/usage--> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.