-
Notifications
You must be signed in to change notification settings - Fork 154
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
Github context is not properly referenced within the JSON payload template #84
Comments
Currently facing the same problem. |
@yousseftarekkh i was able to see github context variables message data in my slack message .
i have received below message in slack |
When using a payload template, slack-action gets the |
I have the same problem with the following snippet in the payload file:
Neither my custom env variable in Any workaround for this? |
This makes me want to switch off from Slack |
I am seeing the same issue here. The payload-file-path template does not replace the env vars in the JSON template. It looks like razor54 has a fix ready to go for this. Seems like the payload-file-path functionality is basically broken until this gets resolved. Workflow code - name: Workflow init slack message
id: slack-init-msg
uses: slackapi/[email protected]
env:
STATUS: "Success"
BRANCH: "DMZ-000_Test_stuff"
APP_NAME: "My_sweet_app"
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
channel-id: "my-test-channel"
payload-file-path: ./.github/slack-msg-payloads/init-msg.json Template JSON file {
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Deployment of ${{ env.APP_NAME }} to ${{ env.ENVIRO }} started",
"emoji": true
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*Workflow URL:* `${{ env.WORKFLOW_URL }}`\n*BRANCH:* `${{ env.BRANCH }}`\n*Triggered by:* `${{ github.actor }}`"
}
]
},
{
"type": "divider"
}
],
"attachments": [
{
"color": "#0328fc",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "This area will be updated with the workflow progress, stay tuned!\n*Workflow status:* ${{ env.STATUS }}"
}
}
]
}
]
} |
any news on this? experiencing the same issue using a slack webhook and a json payload in a template file |
We fixed this in #200; assigning to the 1.24 milestone, which we will release shortly. |
Release v1.24.0 is out! |
Description
Github context is not properly referenced when using the
workflow_run
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Create a
workflow_run
github actionReproducible in:
package version: v1.18.0
node version: v16.13.0
OS version(s):
Steps to reproduce:
workflow_run
events${{github.event.workflow_run.name}}
for exampleExample of my JSON template
Expected result:
I would expect for the JSON file to have in hand the entire provided github context corresponding to the
workflow_run
event triggers.Actual result:
As you can see
${{github.event.workflow_run.name}}
did not work as expectedAlso the regular github context did not work as well, here
Side Node:
I looked into this issue #51, and was aware that the problem got fixed, but I tested it multiple times, it was not properly fixed.
The text was updated successfully, but these errors were encountered: