Repository navigation
feat(ci): expose the lifecycle helper as a GitHub Action #5981
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
openshift-merge-bot
merged 3 commits into
redhat-developer:main
from
gustavolira:rhidp-19630-lifecycle-action
Dec 4, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,54 @@ | ||
| name: "RHDH lifecycle" | ||
| description: "Runs scripts/lifecycle.ts: supported RHDH release branches, the previous Y-stream, or whether a stream is EOL, from the Red Hat Product Life Cycles API" | ||
|
|
||
| inputs: | ||
| command: | ||
| description: "active-branches, previous-y-stream or is-eol" | ||
| required: true | ||
| stream: | ||
| description: "X.Y stream for previous-y-stream and is-eol" | ||
| required: false | ||
| default: "" | ||
| repository-url: | ||
| description: "Repository whose release-* branches are read (default: redhat-developer/rhdh)" | ||
| required: false | ||
| default: "" | ||
| outputs: | ||
| result: | ||
| description: "Three possible outputs, depending on command used. 1. active-branches: space-separated list of branches, from oldest to newest, then main. 2. previous-y-stream: X.Y. 3. is-eol: true or false" | ||
| value: ${{ steps.run.outputs.result }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0 | ||
| with: | ||
| # The project's Node version, so the action moves with the rest of rhdh. | ||
| node-version-file: ${{ github.action_path }}/../../../.nvmrc | ||
|
|
||
| - name: Run scripts/lifecycle.ts | ||
| id: run | ||
| shell: bash | ||
|
nickboldt marked this conversation as resolved.
Resolved
|
||
| env: | ||
| COMMAND: ${{ inputs.command }} | ||
| STREAM: ${{ inputs.stream }} | ||
| LIFECYCLE_REPO_URL: ${{ inputs.repository-url }} | ||
| # A remote action is checked out with its whole repository. | ||
| SCRIPT: ${{ github.action_path }}/../../../scripts/lifecycle.ts | ||
|
gustavolira marked this conversation as resolved.
Resolved
|
||
| run: | | ||
| args=("${COMMAND}") | ||
| [[ -n "${STREAM}" ]] && args+=("${STREAM}") | ||
| status=0 | ||
| result=$(node "${SCRIPT}" "${args[@]}") || status=$? | ||
| if [[ "${COMMAND}" == "is-eol" && "${status}" -le 1 ]]; then | ||
| # is-eol answers through its exit code: 0 EOL, 1 not EOL or unknown. | ||
| result=$([[ "${status}" -eq 0 ]] && echo true || echo false) | ||
| status=0 | ||
| fi | ||
| if [[ "${status}" -ne 0 ]]; then | ||
| echo "::error::lifecycle.ts ${COMMAND} failed with exit code ${status}" | ||
| exit "${status}" | ||
| fi | ||
| echo "${COMMAND}: ${result}" | ||
| echo "result=${result}" >> "${GITHUB_OUTPUT}" | ||
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
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.