Skip to content

Commit

Permalink
action.yml: set value of output to output from step
Browse files Browse the repository at this point in the history
  • Loading branch information
dbertram committed Nov 25, 2024
1 parent 82a6545 commit 3c58671
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ inputs:
outputs:
ts:
description: "The timestamp ID of the message that was just posted"
value: ${{steps.slack-post-message.outputs.ts}}
branding:
icon: 'tag'
color: 'blue'
Expand All @@ -32,7 +33,7 @@ runs:
[[ "${{ inputs.channel }}" ]] || { echo "required input 'channel' not specified" ; exit 1; }
[[ "${{ inputs.text }}" ]] || { echo "required input 'text' not specified" ; exit 1; }
- name: POST to chat.postMessage API
id: slack-post-message-core
id: slack-post-message
shell: bash
run: |
response=$(curl --fail-with-body --silent --show-error \
Expand All @@ -43,12 +44,6 @@ runs:
--data '{"channel": "${{ inputs.channel }}", "thread_ts": "${{ inputs.thread_ts }}", "unfurl_links": ${{ inputs.unfurl_links }}, "text": "${{ inputs.text }}"}' \
)
echo "Slack message API response:\n$response"
echo "Parsing Slack message ts from API response..."
ts=$(echo "$response" | jq --raw-output '.ts')
echo "ts of Slack message: $ts"
echo "Setting ts output to $ts"
echo "ts=$ts" >> $GITHUB_OUTPUT
- name: Confirm previous step output
shell: bash
run: |
echo "ts of Slack message from previous GH Action step: ${{ steps.slack-post-message-core.outputs.ts }}"

0 comments on commit 3c58671

Please sign in to comment.