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 Alert Step Failing #1035

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

connormaglynn
Copy link
Contributor

@connormaglynn connormaglynn commented Nov 19, 2024

👀 Purpose

♻️ What's changed

  • Formatted and stripped newlines from commit messages to try and ensure multi-line commit messages don't cause a JSON parse error
  • Temporarily added a test workflow to send an alert to my testing channel, just to spot any issues when this PR is merged 👀

📓 Notes

  • Expanded the JSON blocks so they're easier to amend

@connormaglynn connormaglynn requested a review from a team as a code owner November 19, 2024 20:42
Copy link
Contributor

github-actions bot commented Nov 19, 2024

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 3 0 0.04s
❌ REPOSITORY gitleaks yes 2 0.74s
✅ REPOSITORY trivy yes no 24.79s
✅ YAML prettier 3 0 0.46s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@connormaglynn connormaglynn force-pushed the fix-failing-alert-not-working branch from 1ce72ae to 3ac1b17 Compare November 19, 2024 21:54
With multiple lines!

And even more lines here!

Just for good measure
@connormaglynn connormaglynn force-pushed the fix-failing-alert-not-working branch from 3037cd4 to 31a53d8 Compare November 19, 2024 22:12
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository *<https://github.com/${{ github.repository }}|${{ github.repository }}>*.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}},
Copy link
Contributor Author

@connormaglynn connormaglynn Nov 20, 2024

Choose a reason for hiding this comment

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

replaced _${{ github.event.head_commit.message }}_ with _${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}_

"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository *<https://github.com/${{ github.repository }}|${{ github.repository }}>*.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}},
Copy link
Contributor Author

@connormaglynn connormaglynn Nov 20, 2024

Choose a reason for hiding this comment

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

replaced ${{ github.event.head_commit.message }} with ${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}

Copy link
Contributor

@ewastempel ewastempel left a comment

Choose a reason for hiding this comment

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

LGTM

@connormaglynn connormaglynn merged commit 1c104b3 into main Nov 20, 2024
8 of 10 checks passed
@connormaglynn connormaglynn deleted the fix-failing-alert-not-working branch November 20, 2024 12:10
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