[NO QA]Add GitHub Action linting#7697
Conversation
| echo 'Lint Github Actions via actionlint (https://github.com/rhysd/actionlint)' | ||
|
|
||
| # If we are running this on a non-CI machine (e.g. locally), install shellcheck | ||
| if [[ -z "${CI}" ]]; then |
There was a problem hiding this comment.
A bit more robust / faster because it won't run brew install shellcheck every time. Also won't try to do brew install on non-macOS computers.
if [[ -z "${CI}" && -z "$(command -v shellcheck)" ]]; then
if [[ "$OSTYPE" != 'darwin'* || -z "$(command -v brew)" ]]; then
echo 'This script requires shellcheck to be installed. Please install it and try again'
exit 1
fi
brew install shellcheck
fi| echo "DEPLOY_BLOCKER_URL=${{ github.event.issue.html_url }}" >> $GITHUB_ENV | ||
| echo "DEPLOY_BLOCKER_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV | ||
| echo "DEPLOY_BLOCKER_TITLE=$(sed -e "s/'/'\\\\''/g; s/\`/\\\\\`/g; 1s/^/'/; \$s/\$/'/" <<< "'${{ github.event.issue.title }}'")" >> $GITHUB_ENV | ||
| { echo "DEPLOY_BLOCKER_URL=${{ github.event.issue.html_url }}"; echo "DEPLOY_BLOCKER_NUMBER=${{ github.event.issue.number }}"; echo "DEPLOY_BLOCKER_TITLE=$(sed -e "s/'/'\\\\''/g; s/\`/\\\\\`/g; 1s/^/'/; \$s/\$/'/" <<< "$TITLE")";} >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Uhhhh what is this code? It wasn't great before either so NAB but I'm wondering if we could clean this up ... Any idea what that sed is doing? 😬
There was a problem hiding this comment.
At minimum, can we break it into multiple lines w/ \ ?
There was a problem hiding this comment.
It was complaining that I needed to lump the commands together, but I will try new lines with \
There was a problem hiding this comment.
Well ... still NAB because you didn't introduce this.
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks pretty good to me as much as I understand it.
|
Thanks for the review @roryabraham and @neil-marcellini! I will pick up the review comments later today. |
Co-authored-by: Rory Abraham <47436092+roryabraham@users.noreply.github.com>
|
🚀 Deployed to staging by @AndrewGable in version: 1.1.39-1 🚀
|
Details
We have had a few failures and security vulnerabilities reported by this static analyzer, so I've done two things:
" "needing to be applied)validateActionsAndWorkflows.shFixed Issues
$ #7703
Tests