-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow that lints shell scripts with ShellCheck (#147)
* Add workflow that lints shell scripts with ShellCheck Signed-off-by: Jack Baldry <[email protected]> * Replace inline script with script file Signed-off-by: Jack Baldry <[email protected]> * Lint for style I've not bothered saving this patch for reapplication if upstream changes because we had already deviated from that before these changes. - Use consistent variable syntax - Prefer `-n` over `! -z` - Use appropriate quoting for words that have no variable expansion Signed-off-by: Jack Baldry <[email protected]> * Move to lint-shared-workflows action Signed-off-by: Jack Baldry <[email protected]> * Lint translate-secrets script - Remove useless echo subshell - Set readonly variables for to clarify when the script is no longer going to modify those variables. Signed-off-by: Jack Baldry <[email protected]> * Lint README for Grafana Labs style https://grafana.com/docs/writers-toolkit/ - Simplify some language for improved readability - Prefer [semantic line breaks](https://sembr.org/) for better line based diffing in the GitHub UI. Signed-off-by: Jack Baldry <[email protected]> * Document preference for separate shell scripts Signed-off-by: Jack Baldry <[email protected]> * Revert "Lint README for Grafana Labs style" This reverts commit 4278510. * Restore documentation dropped in conflict resolution Signed-off-by: Jack Baldry <[email protected]> * Clean up whitespace Signed-off-by: Jack Baldry <[email protected]> --------- Signed-off-by: Jack Baldry <[email protected]> Co-authored-by: Dimitris Sotirakis <[email protected]>
- Loading branch information
1 parent
6426ecd
commit 570898e
Showing
6 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
# Pulled from catnekaise/cognito-idpool-auth/action.yml | ||
# https://github.com/catnekaise/cognito-idpool-auth/blob/83ae9e159de469b3acd87ecb361d6b5957ee35ae/action.yml#L192-L227 | ||
value="" | ||
|
||
if [ -n "${AWS_REGION}" ] && [ -n "${AWS_DEFAULT_REGION}" ]; then | ||
value="$AWS_REGION" | ||
fi | ||
|
||
readonly value | ||
|
||
if [ -z "${value}" ]; then | ||
echo 'Unable to resolve what AWS region to use' | ||
exit 1 | ||
fi | ||
|
||
# Some-effort validation of aws region | ||
if echo "${value}" | grep -Eqv '^[a-z]{2}-[a-z]{4,9}-[0-9]$'; then | ||
echo 'Resolved value for AWS region is invalid' | ||
exit 1 | ||
fi | ||
|
||
echo "value=${value}" >> "${GITHUB_OUTPUT}" | ||
echo "AWS_REGION=${AWS_REGION}" >> "${GITHUB_ENV}" | ||
echo "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" >> "${GITHUB_ENV}" |
This file contains 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
This file contains 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