Skip to content

Commit 56ce55a

Browse files
committed
Fix JSON parsing error in Mattermost notification workflow
The workflow was using deprecated ::set-output syntax to pass JSON payload, which caused 'Expected property name or } in JSON at position 1' errors. Changes: - Removed the intermediate 'Read Content' step that used ::set-output - Changed from PAYLOAD to PAYLOAD_FILENAME parameter - Now passes mattermost.json file directly to the action This approach avoids JSON escaping issues when passing complex payloads through GitHub Actions outputs. The mattermost-action-notify action supports PAYLOAD_FILENAME for reading JSON from a file, which is more reliable than passing JSON strings through output variables. Fixes: https://github.com/uitsmijter/Documentation/actions/runs/19265980048
1 parent 671fdb0 commit 56ce55a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

.github/workflows/builds-mattermost.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ jobs:
5656
--arg link "$LINK" \
5757
'{text: ("## \($icon) \($ref)\nStatus: \($status)\nin: [\($repo)](\($repo_url)) by: **\($author)**\n\n```text\n\($body)\n```\n----\n[Commit](\($link))")}' \
5858
> mattermost.json
59-
- name: Read Content
60-
id: getcontent
61-
run: echo "::set-output name=payload::$(cat mattermost.json)"
6259
- name: Send Mattermost Message
6360
uses: mattermost/action-mattermost-notify@master
6461
with:
6562
MATTERMOST_WEBHOOK_URL: ${{ secrets.WEBHOOK }}
66-
PAYLOAD: ${{ steps.getcontent.outputs.payload }}
63+
PAYLOAD_FILENAME: mattermost.json

0 commit comments

Comments
 (0)