-
Notifications
You must be signed in to change notification settings - Fork 3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6ecac72
Add bundle action and reusable workflow
cotti c0ef979
Add README
cotti f4dff47
Split action into bundle generation and PR submission. Readjusted nam…
cotti b4114ea
Security fixes
cotti c5a579b
Use --force-with-lease instead of -f
cotti 3b9ca23
Add --prs support
cotti 07f68e0
Add support for profile-based bundling
cotti b76fe87
Use env vars for docker run
cotti 0f192ff
Validate paths
cotti e72f79c
Update README
cotti 5d756ca
Adjust action to use docs-builder changelog bundle --plan
cotti 7d389f6
Set outputs instead
cotti 867171d
Update README
cotti f05b153
Fix README
cotti f1cd6ae
Harden input validation
cotti 34c424c
Pin docs-builder version using attestation-verify
cotti e649908
Add domain allowlist for report URLs
cotti e24314b
revert tackling ssrf in the action
cotti 845ecd5
Update README
cotti cf1de3d
Rework bundling strategy
cotti 0bd806d
Merge remote-tracking branch 'origin' into feature/bundle_action
cotti 2c639d2
Use the private bucket for uploads
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,97 @@ | ||
| name: Changelog bundle PR | ||
|
|
||
| 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). | ||
| Used for {version} substitution in profile patterns. | ||
| 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. | ||
| 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. | ||
| 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 | ||
| base-branch: | ||
| description: 'Base branch for the pull request (defaults to repository default branch)' | ||
| 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-pr-${{ inputs.output || inputs.profile }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Changelog bundle | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| mode: | ||
| description: > | ||
| Operation mode: 'bundle' (default) runs changelog bundle, | ||
| 'gh-release' runs changelog gh-release to create changelogs | ||
| from a GitHub release. In gh-release mode, repo and version | ||
| are required. | ||
| type: string | ||
| default: 'bundle' | ||
| 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 (e.g. 9.2.0). In bundle profile mode, used | ||
| for {version} substitution. In gh-release mode, used as the | ||
| release tag to fetch. | ||
| 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 | ||
| 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 | ||
| strip-title-prefix: | ||
| description: 'Remove [Prefix]: from PR titles (gh-release mode only)' | ||
| type: boolean | ||
| default: false | ||
| 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' | ||
| aws-account-id: | ||
| description: 'AWS account ID for OIDC. Only override if provisioned for the target account.' | ||
| type: string | ||
| default: '197730964718' | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: changelog-bundle-${{ inputs.output || inputs.profile }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
|
cotti marked this conversation as 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: | ||
| mode: ${{ inputs.mode }} | ||
| 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 }} | ||
| strip-title-prefix: ${{ inputs.strip-title-prefix }} | ||
| docs-builder-version: ${{ inputs.docs-builder-version }} | ||
| github-token: ${{ github.token }} | ||
|
|
||
| upload: | ||
| needs: generate | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: elastic/docs-actions/changelog/bundle-upload@v1 | ||
| with: | ||
| output: ${{ needs.generate.outputs.output }} | ||
| config: ${{ inputs.config }} | ||
| docs-builder-version: ${{ inputs.docs-builder-version }} | ||
| aws-account-id: ${{ inputs.aws-account-id }} | ||
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.