You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add release id output to publish-github-release
* publish draft version
* make github_token input optional
* use github.token in workflow
* add step to trigger release workflow
* trigger release workflow
* add release workflow ref
* remove temp workflows
* pass NA for releas ID when draft is set to true:
* fix get run id
* update permissions in readme
* revert readme teble format change
* Update publish-github-release/action.yml
Co-authored-by: GabinL21 <[email protected]>
* increase sleep after publishing release
* switch releaseTagName to version
---------
Co-authored-by: GabinL21 <[email protected]>
Copy file name to clipboardExpand all lines: publish-github-release/README.md
+34-15Lines changed: 34 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,33 +5,52 @@ directly from a Jira release version, or it can use release notes provided direc
5
5
6
6
This action uses the GitHub CLI to create the release and a Python script to interact with the Jira API.
7
7
8
+
## Duplicate Release Handling
9
+
10
+
The action automatically checks for existing releases with the same title before creating a new one:
11
+
12
+
-**When `draft=true`**: If a release with the same title already exists, the action logs a warning and skips creation without failing.
13
+
-**When `draft=false`**: If an existing draft release with the same title is found, it will be published instead of creating a new release. If a published release with the same title already exists, the action will fail with an error.
14
+
15
+
## Release Workflow Triggering
16
+
17
+
After creating the GitHub release, this action automatically triggers a release workflow in the caller repository using the GitHub CLI. The action:
18
+
19
+
- Triggers the specified release workflow (default: `release.yml`) on the specified branch or ref (default: `master`)
20
+
- Passes the release tag name, release ID, and dry-run flag (based on the `draft` input) to the triggered workflow
21
+
- Monitors the workflow execution and waits for it to complete
22
+
- Succeeds if the release workflow completes successfully, or fails if the release workflow fails
23
+
24
+
This ensures that the entire release process (GitHub release creation + downstream release workflow) succeeds or fails as a unit.
25
+
8
26
## Prerequisites
9
27
10
28
To fetch release notes from Jira, the action requires that the repository has the `development/kv/data/jira` token
Copy file name to clipboardExpand all lines: publish-github-release/action.yml
+119-4Lines changed: 119 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -43,10 +43,14 @@ inputs:
43
43
description: 'The GitHub token for API calls.'
44
44
required: true
45
45
default: ${{ github.token }}
46
-
wait_for_workflow_name:
47
-
description: 'The name or file name of the workflow to wait for upon a non-draft release (e.g., "sonar-release" or "release.yml"). If empty, this step is skipped.'
46
+
release_workflow:
47
+
description: 'The filename of the release workflow to trigger in the caller repository.'
48
48
required: false
49
-
default: 'sonar-release'
49
+
default: 'release.yml'
50
+
release_workflow_ref:
51
+
description: 'The branch or ref to trigger the release workflow from.'
echo "Triggering release workflow '${{ inputs.release_workflow }}' with tag '${{ inputs.version }}', release ID '$RELEASE_ID_VALUE', and dryRun=${{ inputs.draft }}..."
189
+
190
+
# Trigger the workflow
191
+
gh workflow run "${{ inputs.release_workflow }}" \
192
+
--repo "${{ github.repository }}" \
193
+
--ref "${{ inputs.release_workflow_ref }}" \
194
+
-f "version=${{ inputs.version }}" \
195
+
-f "releaseId=$RELEASE_ID_VALUE" \
196
+
-f "dryRun=${{ inputs.draft }}"
197
+
198
+
echo "Workflow triggered successfully"
199
+
200
+
# Wait a moment for the workflow to start, then get the run ID
201
+
sleep 30
202
+
203
+
RUN_ID=$(gh run list \
204
+
--repo "${{ github.repository }}" \
205
+
--workflow "${{ inputs.release_workflow }}" \
206
+
--limit 1 \
207
+
--json databaseId \
208
+
--jq '.[0].databaseId')
209
+
210
+
if [[ -z "$RUN_ID" ]] || [[ "$RUN_ID" == "null" ]]; then
0 commit comments