Skip to content

Commit 121f4a2

Browse files
GHA-157 Define default value for release automation secret name in automated release workflow (#72)
Co-authored-by: Roberto Orlandi <71495874+roberto-orlandi-sonarsource@users.noreply.github.com>
1 parent a972635 commit 121f4a2

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/automated-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838
required: true
3939
type: string
4040
release-automation-secret-name:
41-
description: "Release automation secret name to create integration PRs in SQS and SQC"
41+
description: "Release automation secret name to create integration PRs in SQS and SQC. If not provided uses `sonar-{plugin-name}-release-automation` as default."
4242
required: false
4343
type: string
4444
short-description:
@@ -507,7 +507,7 @@ jobs:
507507
release-version: ${{ needs.prepare-release.outputs.release-version }}
508508
ticket-key: ${{ needs.create-integration-tickets.outputs.sqs-ticket-key }}
509509
plugin-name: ${{ inputs.plugin-name }}
510-
secret-name: ${{ inputs.release-automation-secret-name }}
510+
secret-name: ${{ inputs.release-automation-secret-name || format('sonar-{0}-release-automation', inputs.plugin-name) }}
511511
plugin-artifacts: ${{inputs.plugin-artifacts-sqs || inputs.plugin-name }}
512512
draft: ${{ inputs.is-draft-release }}
513513
reviewers: ${{ github.actor }}
@@ -520,7 +520,7 @@ jobs:
520520
release-version: ${{ needs.prepare-release.outputs.release-version }}
521521
ticket-key: ${{ needs.create-integration-tickets.outputs.sqc-ticket-key }}
522522
plugin-name: ${{ inputs.plugin-name }}
523-
secret-name: ${{ inputs.release-automation-secret-name }}
523+
secret-name: ${{ inputs.release-automation-secret-name || format('sonar-{0}-release-automation', inputs.plugin-name) }}
524524
plugin-artifacts: ${{inputs.plugin-artifacts-sqc || inputs.plugin-name }}
525525
draft: ${{ inputs.is-draft-release }}
526526
reviewers: ${{ github.actor }}

docs/AUTOMATED_RELEASE.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This workflow composes several actions from this repository:
4343
| `use-jira-sandbox` | Use Jira sandbox | No | `true` |
4444
| `is-draft-release` | Create the GitHub release as a draft | No | `true` |
4545
| `pm-email` | Product manager email to assign the release ticket after technical release | Yes | - |
46-
| `release-automation-secret-name` | Secret name used to create analyzer update PRs | No | - |
46+
| `release-automation-secret-name` | Secret name used to create analyzer update PRs. If omitted, defaults to `sonar-{plugin-name}-release-automation`. | No | - |
4747
| `short-description` | Brief summary for release and integration tickets | Yes | - |
4848
| `rule-props-changed` | Whether rule properties changed (`true`/`false`); mapped to Yes/No in the release ticket | Yes | - |
4949
| `branch` | Branch to release from | Yes | `master` |
@@ -107,15 +107,14 @@ jobs:
107107
with:
108108
jira-project-key: CSD
109109
project-name: "Cloud Security"
110-
plugin-name: "sonar-secrets"
110+
plugin-name: "csd"
111111
pm-email: "pm@example.com"
112112
short-description: ${{ inputs.short-description }}
113113
rule-props-changed: "false"
114114
branch: "master"
115115
new-version: ${{ inputs.new-version }}
116116
sqs-integration: true
117117
sqc-integration: true
118-
release-automation-secret-name: "sonar-csd-release-automation"
119118
slack-channel: "release-notifications"
120119
verbose: ${{ inputs.verbose }}
121120
```
@@ -128,14 +127,14 @@ jobs:
128127
- Unlock the branch after the GitHub release is published
129128
- Send lock/unlock notifications to the configured `slack-channel` if provided
130129
- When `release-notes` is empty, Jira release notes are fetched and used.
131-
- Integration tickets and analyzer update PRs are created only if their respective flags are enabled and prerequisites are met (e.g., secret name for PR creation).
130+
- Integration tickets and analyzer update PRs are created only if their respective flags are enabled and prerequisites are met.
132131
- Summaries:
133132
- Each job includes a "Summary" step that writes to `$GITHUB_STEP_SUMMARY` only when `verbose: true`.
134133
- Permissions and environments are scoped per job to minimize required privileges.
135134

136135
## Troubleshooting
137136

138137
- Ensure the caller repository has appropriate permissions to use this workflow and to write releases and PRs.
139-
- Verify that `release-automation-secret-name` exists and grants access for creating analyzer update PRs.
138+
- Verify that `release-automation-secret-name` exists and grants access for creating analyzer update PRs. If omitted, ensure the default secret (`sonar-{plugin-name}-release-automation`) exists and is configured with the required permissions.
140139
- Check job logs if the final summary indicates failure; the per-job logs contain detailed outputs even when `verbose` is disabled.
141140
- Ensure the `Jira Tech User GitHub` is an Administrator on the target Jira project; admin rights are required to release the Jira version and to create a new version.

0 commit comments

Comments
 (0)