Skip to content

feat(slack-workflow-notification): add tag input#351

Open
aymkhalil wants to merge 1 commit intomainfrom
feat/slack-new-input
Open

feat(slack-workflow-notification): add tag input#351
aymkhalil wants to merge 1 commit intomainfrom
feat/slack-new-input

Conversation

@aymkhalil
Copy link
Collaborator

@aymkhalil aymkhalil commented Dec 17, 2025

Adds a new tag input to the slack workflow-notification to override the sha that gets posted in the default slack messages.

This came out as we usually used this action with our prod deployments - currently the short sha in Commit is actually the the head of the branch from which the deployment workflow is triggered, however it is often desirable that this is actually the sha of the tag benign deployed.

Example: https://kongstrong.slack.com/archives/C1F8S1TS4/p1765878446308509

The Commit:2d3e4d3 is actually top of the branch, not the tag being deployed which is rather v0.3776.287: https://github.com/kong-konnect/kauth/commit/4c238c429da25406f9ed7d9cfe2e0fb16da6aaa3

Since we have tag handy, I just proposed we pass it along the action like:

      - name: Send Notification
        uses: Kong/public-shared-actions/slack-actions/workflow-notification@ba5f6140d799d220f6417e74d9bfda1116fddc9a
        with:
          slack-webhook-url: ...
          status: ...
          success-message: ...
          tag: ${{ inputs.tag }}

and the action will resolve it.

There are three possible outcomes:

status-message=Deploying `gh-actions-lab` tag `` to prod environment: *us*
short-commit-hash=94f6f55
Error resolving tag 'v0.1133.0': fatal: ambiguous argument 'v0.1133.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
v0.1133.0
Falling back to current workflow commit hash: 94f6f5501bdb486b50605da4e43ff2da41393c6c
status-message=Deploying `gh-actions-lab` tag `v0.1133.0` to prod environment: *us*
short-commit-hash=94f6f55
Resolved tag 'v1.0.0' to commit hash: 16747179ede63ce1e257ad27efb3f2955b2b65b0
status-message=Deploying `gh-actions-lab` tag `v1.0.0` to prod environment: *us*
short-commit-hash=1674717

Not that the assumption here is that tag is lightweight which is dominantly what we use when tagging releases.

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Luacheck Report

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
4 tests ±0  4 ✅ ±0  0 💤 ±0  0 ❌ ±0 
8 runs  ±0  8 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit afe4235. ± Comparison against base commit 5af8679.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants