-
Notifications
You must be signed in to change notification settings - Fork 149
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
Problems persist using payload file #203
Comments
Not sure if relevant, but we are using self-hosted runners on GH (and here the rendering of the variables in the payload file fails). Is your working example (mentioned above) also using self-hosted runners? |
+1 this issue makes it way harder than it needs to be to write payload messages based on job status, even making the payload.json exactly the way the examples in the repo show it. |
It would be amazing if this could be prioritized by the maintainers. It would help us a lot to make our workflows slimmer, since we currently can't extract the payload json to a separate files exactly due to the issues described before. |
@filmaj Let me know if you need any help recreating the issue. I can share context where I am facing the same issue |
Sure @joshua-reddish any examples of the failure, including the payload, which GitHub event is triggering the failure and how this action is being called, is helpful. |
It needs to be mentioned that the workaround as suggested by @victorouse in #203 (comment) works perfectly. ps. I have to agree that the way you've found does come to being much cleaner. :) |
Workflow is triggered by push to a specific branch Payload {
"text": "`repoName` _feat_ deployment job# ${{ github.run_id }} triggered by *${{github.actor}}* ${{ jobs.deploy.result == 'success' && 'is successful :thumbsup:' || 'has failed :error:' }}\n${{ github.repositoryUrl }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "`repoName` _feat_ deployment job# *${{ github.run_id }}* triggered by *${{github.actor}}* *${{ jobs.deploy.result == 'success' && 'is successful :thumbsup:' || 'has failed :error:' }}*\n*${{ github.repositoryUrl }}*"
}
}
] Oddly enough, the only thing that rendered correctly in this was the Here is the action call: # Send a Slack message using Webhooks
- name: slack-webhook-message
id: slack-webhook-message
uses: slackapi/slack-github-action@v1.24.0
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: ${{ env.slackWebhookType }}
with:
payload-file-path: ${{ env.slackPayLoadFilePath }} |
I can confirm that this continues to be an issue, making it really hard to work with complex message structures |
🗒️ Did a bit of digging into this and it's caused by how variables are parsed in payloads in the action versus from file. Expressions defined in the action Templatized expressions in the @victorouse has a great workaround for this already! I'm not immediately sure how other variables can be included within the action replacement - those of I plan to add more documentation around this case soon, but let's keep this issue open to track progress and learnings on the topic! |
🏷️ Not a complete solution to the |
See #159 (comment) and follow-up comments.
However, the tests run by this repo in GitHub Actions seem to render correctly on our (internal) Slack workspace.
Need to reproduce / figure out what is going on.
The text was updated successfully, but these errors were encountered: