Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support response output #73

Closed
4 of 10 tasks
SnowCait opened this issue Mar 9, 2022 · 1 comment · Fixed by #74
Closed
4 of 10 tasks

Support response output #73

SnowCait opened this issue Mar 9, 2022 · 1 comment · Fixed by #74
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@SnowCait
Copy link

SnowCait commented Mar 9, 2022

Description

Action outputs API response, we can get thread_ts value in next steps.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Example

jobs:
  post:
    runs-on: ubuntu-latest
    env:
      SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

    steps:
      - uses: slackapi/slack-github-action@v1.18.0
        id: slack
        with:
          channel-id: '#general'
          slack-message: "Summary"
      - uses: slackapi/slack-github-action@v1.18.0
        with:
          channel-id: '#general'
          payload: |
            {
              "text": "Details",
              "thread_ts": "${{ fromJSON(steps.slack.outputs.response).ts }}"
            }
@stevengill
Copy link
Member

Hmm this is a pretty good idea.

I don't think we would be able to provide this for the webhook usecases, but would be useful when using the bot token route.

example output from a successful chat.postMessage

{
    "ok": true,
    "channel": "C1H9RESGL",
    "ts": "1503435956.000247",
    "message": {
        "text": "Here's a message for you",
        "username": "ecto1",
        "bot_id": "B19LU7CSY",
        "attachments": [
            {
                "text": "This is an attachment",
                "id": 1,
                "fallback": "This is an attachment's fallback"
            }
        ],
        "type": "message",
        "subtype": "bot_message",
        "ts": "1503435956.000247"
    }
}

@stevengill stevengill added enhancement New feature or request good first issue Good for newcomers labels Mar 9, 2022
@seratch seratch added this to the 1.x milestone Mar 9, 2022
@stevengill stevengill assigned stevengill and unassigned stevengill Mar 9, 2022
stevengill added a commit that referenced this issue Mar 9, 2022
@stevengill stevengill self-assigned this Mar 9, 2022
@seratch seratch modified the milestones: 1.x, 1.19 Mar 9, 2022
stevengill added a commit that referenced this issue Mar 18, 2022
stevengill added a commit that referenced this issue May 4, 2022
* added thread-ts as an output. Fixes #73

* added example of thread_ts being used in a followup step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants