-
Notifications
You must be signed in to change notification settings - Fork 1
BUILD-11459: Add update-release-channel composite action skeleton #273
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
jayadeep-km-sonarsource
merged 1 commit into
master
from
feat/jd/BUILD-11459-updateReleaseChannelSkeleton
May 28, 2026
+100
−0
Merged
Changes from all commits
Commits
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,67 @@ | ||
| --- | ||
| name: Update release channel | ||
| description: | | ||
| Update a release channel pointer (e.g. `Distribution/<product>/latest.json`) on | ||
| `binaries.sonarsource.com` so consumers can discover the currently published version. | ||
| inputs: | ||
| version: | ||
| description: Version that the channel should be updated to point at (e.g. `0.9.0.977`). | ||
| required: true | ||
| channel: | ||
| description: Release channel name. One of `latest`, `stable`, `beta`, `rc`. | ||
| default: latest | ||
| prefix: | ||
| description: S3 key prefix under the bucket. Defaults to `Distribution` (existing layout convention). | ||
| default: Distribution | ||
| product: | ||
| description: Product folder name on S3. Defaults to the GitHub repository name. | ||
| default: ${{ github.event.repository.name }} | ||
| dryRun: | ||
| description: | | ||
| When `true`, resolve and validate inputs and print the planned `PutObject` without fetching | ||
| Vault credentials or writing to S3. | ||
| default: 'false' | ||
| outputs: | ||
| bucket: | ||
| description: S3 bucket the channel pointer was (or would be) written to. | ||
| value: ${{ steps.write.outputs.bucket }} | ||
| key: | ||
| description: S3 key of the channel pointer (e.g. `Distribution/<product>/<channel>.json`). | ||
| value: ${{ steps.write.outputs.key }} | ||
| etag: | ||
| description: ETag returned by S3 after `PutObject`. Empty in dry-run. | ||
| value: ${{ steps.write.outputs.etag }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Resolve action path | ||
| shell: bash | ||
| run: | | ||
| ACTION_PATH_URC="${{ github.action_path }}" | ||
| echo "ACTION_PATH_URC=$ACTION_PATH_URC" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Fetch AWS credentials from Vault | ||
| id: secrets | ||
| if: inputs.dryRun != 'true' | ||
| uses: SonarSource/vault-action-wrapper@c154b4a417b51cb98dd71137f49bf20e77c56820 # 3.4.0 | ||
| with: | ||
| secrets: | | ||
| development/aws/sts/downloads access_key | AWS_ACCESS_KEY_ID; | ||
| development/aws/sts/downloads secret_key | AWS_SECRET_ACCESS_KEY; | ||
| development/aws/sts/downloads security_token | AWS_SESSION_TOKEN; | ||
|
|
||
| - name: Write channel pointer | ||
| id: write | ||
| shell: bash | ||
| env: | ||
| VERSION: ${{ inputs.version }} | ||
| CHANNEL: ${{ inputs.channel }} | ||
| PREFIX: ${{ inputs.prefix }} | ||
| PRODUCT: ${{ inputs.product }} | ||
| DRY_RUN: ${{ inputs.dryRun }} | ||
| AWS_DEFAULT_REGION: eu-central-1 | ||
| AWS_ACCESS_KEY_ID: ${{ inputs.dryRun != 'true' && fromJSON(steps.secrets.outputs.vault).AWS_ACCESS_KEY_ID || '' }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ inputs.dryRun != 'true' && fromJSON(steps.secrets.outputs.vault).AWS_SECRET_ACCESS_KEY || '' }} | ||
| AWS_SESSION_TOKEN: ${{ inputs.dryRun != 'true' && fromJSON(steps.secrets.outputs.vault).AWS_SESSION_TOKEN || '' }} | ||
| run: ${ACTION_PATH_URC}/write_channel.sh |
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,33 @@ | ||
| #!/bin/bash | ||
| # Resolve inputs for the update-release-channel action and write the channel pointer to S3. | ||
| # | ||
| # Required environment variables (provided by action.yml): | ||
| # - VERSION: Version the channel should point at. | ||
| # - CHANNEL: Channel name (`latest`, `stable`, `beta`, `rc`). | ||
| # - PREFIX: S3 key prefix (e.g. `Distribution`). | ||
| # - PRODUCT: Product folder name on S3 (defaults to the GitHub repository name). | ||
| # - DRY_RUN: `true` to skip any real AWS call. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| : "${VERSION:?}" "${CHANNEL:?}" "${PREFIX:?}" "${PRODUCT:?}" | ||
| : "${DRY_RUN:=false}" | ||
|
|
||
| BUCKET="downloads-cdn-eu-central-1-prod" | ||
| KEY="${PREFIX}/${PRODUCT}/${CHANNEL}.json" | ||
|
|
||
| echo "::group::Resolved inputs" | ||
| echo "version: ${VERSION}" | ||
| echo "channel: ${CHANNEL}" | ||
| echo "prefix: ${PREFIX}" | ||
| echo "product: ${PRODUCT}" | ||
| echo "dryRun: ${DRY_RUN}" | ||
| echo "bucket: ${BUCKET}" | ||
| echo "key: ${KEY}" | ||
| echo "::endgroup::" | ||
|
|
||
| { | ||
| echo "bucket=${BUCKET}" | ||
| echo "key=${KEY}" | ||
| echo "etag=" | ||
| } >> "${GITHUB_OUTPUT:?}" | ||
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.