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

Fix workflow json encoding #2413

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Fix workflow json encoding #2413

merged 1 commit into from
Jan 10, 2025

Conversation

andrewleith
Copy link
Member

Summary | Résumé

Update the way the json is encoded when passed to a slack webhook in a github workflow.

Related Issues | Cartes liées

Test instructions | Instructions pour tester la modification

TODO: Fill in test instructions for the reviewer.

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

  • This PR does not break existing functionality.
  • This PR does not violate GCNotify's privacy policies.
  • This PR does not raise new security concerns. Refer to our GC Notify Risk Register document on our Google drive.
  • This PR does not significantly alter performance.
  • Additional required documentation resulting of these changes is covered (such as the README, setup instructions, a related ADR or the technical documentation).

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

@@ -74,5 +74,5 @@ jobs:
- name: Notify Slack channel if this job failed
if: ${{ failure() }}
run: |
json='{"text":"<!here> CI is failing in <https://github.com/cds-snc/notification-api/actions/runs/${GITHUB_RUN_ID}|notification-api> !"}'
json='{"text":"<!here> CI is failing in <https://github.com/cds-snc/notification-api/actions/runs/'${{ github.run_id }}'|notification-api> !"}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Did you test this? there's a lot of single quotes in here!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Well, i went through many iterations in admin to get this right. Here is the equivalent code in admin that I confirmed posted the message correctly to slack: https://github.com/cds-snc/notification-admin/pull/2041/files

@andrewleith andrewleith merged commit 981681f into main Jan 10, 2025
5 checks passed
@andrewleith andrewleith deleted the fix/workflow-json-encoding branch January 10, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants