Created
January 30, 2023 17:21
-
-
Save Coledunsby/8b24baed35382d551de9afe0338eeb5b to your computer and use it in GitHub Desktop.
Convert SwiftLint's output into GitHub Actions Logging commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # modified from https://github.com/norio-nomura/action-swiftlint | |
| # convert swiftlint's output into GitHub Actions Logging commands | |
| # https://help.github.com/en/github/automating-your-workflow-with-github-actions/development-tools-for-github-actions#logging-commands | |
| function convertToGitHubActionsLoggingCommands() { | |
| sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 file=\1,line=\2,col=\3::\5/' | |
| } | |
| set -o pipefail && mint run swiftlint --strict | convertToGitHubActionsLoggingCommands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment