Skip to content

Commit e4f1de7

Browse files
fix(ci): set release-tag input slack bot action (#416)
1 parent 2a731f2 commit e4f1de7

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.github/actions/release-slack-bot/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Release Slack Bot"
22
description: "Release Slack Bot"
33
inputs:
4+
release-tag:
5+
required: true
6+
description: "Release tag"
47
slack-token:
58
required: true
69
description: "Slack token"
@@ -13,7 +16,7 @@ runs:
1316
method: chat.postMessage
1417
token: ${{ inputs.slack-token }}
1518
payload: |
16-
username: ${{ job.status == 'success' && format('Released codegen@{0}', github.ref_name) || format('Failed to release codegen@{0}', github.ref_name) }}
19+
username: ${{ job.status == 'success' && format('Released codegen@{0}', inputs.release-tag) || format('Failed to release codegen@{0}', inputs.release-tag) }}
1720
channel: "#release"
1821
icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
1922
text: |

.github/workflows/auto-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Semantic version
1010
runs-on: ubuntu-latest
1111
outputs:
12-
tag: ${{ steps.semantic.outputs.git-tag }}
12+
release-tag: ${{ steps.semantic.outputs.git-tag }}
1313
permissions:
1414
checks: read # to wait for required checks
1515
contents: write # to be able to publish a GitHub release
@@ -36,11 +36,11 @@ jobs:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737

3838
release:
39-
if: ${{ needs.semantic-version.outputs.tag }}
39+
if: ${{ needs.semantic-version.outputs.release-tag }}
4040
needs: semantic-version
4141
uses: ./.github/workflows/release.yml
4242
permissions:
4343
contents: write
4444
secrets: inherit
4545
with:
46-
tag: ${{ needs.semantic-version.outputs.tag }}
46+
release-tag: ${{ needs.semantic-version.outputs.release-tag }}

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build & Release
33
on:
44
workflow_call:
55
inputs:
6-
tag:
6+
release-tag:
77
required: true
88
type: string
99
description: Tag to release
@@ -13,7 +13,7 @@ on:
1313
# tag:
1414
# required: true
1515
# type: string
16-
# description: Tag to release # TODO: create if it does not exist
16+
# description: Tag to release
1717
push:
1818
tags:
1919
- v*
@@ -51,7 +51,7 @@ jobs:
5151
- uses: actions/checkout@v4
5252
with:
5353
fetch-depth: 0
54-
ref: ${{ inputs.tag || github.event.pull_request.head.ref || github.ref }}
54+
ref: ${{ inputs.release-tag || github.event.pull_request.head.ref || github.ref }}
5555

5656
- name: Install UV
5757
uses: astral-sh/[email protected]
@@ -80,7 +80,7 @@ jobs:
8080
path: ./wheelhouse/*.whl
8181

8282
release:
83-
if: ${{ inputs.tag || startsWith(github.ref, 'refs/tags/') }}
83+
if: ${{ inputs.release-tag || startsWith(github.ref, 'refs/tags/') }}
8484
needs: build
8585
runs-on: ubuntu-latest
8686
environment: release
@@ -108,7 +108,7 @@ jobs:
108108
id: github-release
109109
uses: softprops/action-gh-release@v2
110110
with:
111-
tag_name: ${{ inputs.tag || github.ref_name }}
111+
tag_name: ${{ inputs.release-tag || github.ref_name }}
112112
files: dist/*
113113
fail_on_unmatched_files: true
114114
generate_release_notes: ${{ startsWith(github.ref, 'refs/tags/') }}
@@ -117,5 +117,5 @@ jobs:
117117
if: always()
118118
uses: ./.github/actions/release-slack-bot
119119
with:
120-
release-tag: ${{ github.ref_name }}
120+
release-tag: ${{ inputs.release-tag || github.ref_name }}
121121
slack-token: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)