Add ShellCheck workflow
This commit is contained in:
10
.github/workflows/lint.yml
vendored
Normal file
10
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
on: pull_request
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: ShellCheck
|
||||||
|
uses: ludeeus/action-shellcheck@1.1.0
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2086
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Capture Connect configuration in $GITHUB_ENV, giving (optional) inputs
|
# Capture Connect configuration in $GITHUB_ENV, giving (optional) inputs
|
||||||
# precendence over OP_CONNECT_* environment variables.
|
# precendence over OP_CONNECT_* environment variables.
|
||||||
|
|
||||||
OP_CONNECT_HOST=${INPUT_CONNECT_HOST:-$OP_CONNECT_HOST}
|
OP_CONNECT_HOST="${INPUT_CONNECT_HOST:-$OP_CONNECT_HOST}"
|
||||||
if [ -n "$OP_CONNECT_HOST" ]; then
|
if [ -n "$OP_CONNECT_HOST" ]; then
|
||||||
echo "OP_CONNECT_HOST=$OP_CONNECT_HOST" >> $GITHUB_ENV
|
echo "OP_CONNECT_HOST=$OP_CONNECT_HOST" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OP_CONNECT_TOKEN=${INPUT_CONNECT_TOKEN:-$OP_CONNECT_TOKEN}
|
OP_CONNECT_TOKEN="${INPUT_CONNECT_TOKEN:-$OP_CONNECT_TOKEN}"
|
||||||
if [ -n "$OP_CONNECT_TOKEN" ]; then
|
if [ -n "$OP_CONNECT_TOKEN" ]; then
|
||||||
echo "OP_CONNECT_TOKEN=$OP_CONNECT_TOKEN" >> $GITHUB_ENV
|
echo "OP_CONNECT_TOKEN=$OP_CONNECT_TOKEN" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2046,SC2001,SC2086
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
managed_by_statement="Managed by 1Password"
|
managed_by_statement="Managed by 1Password"
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
set -e
|
||||||
|
|
||||||
assert_env_equals() {
|
assert_env_equals() {
|
||||||
if [ "$(printenv $1)" != "$2" ]; then
|
if [ "$(printenv $1)" != "$2" ]; then
|
||||||
echo -e "Expected $1 to be set to:\n$2\nBut got:\n$(printenv $1)"
|
echo -e "Expected $1 to be set to:\n$2\nBut got:\n$(printenv $1)"
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
set -e
|
||||||
|
|
||||||
assert_env_unset() {
|
assert_env_unset() {
|
||||||
if [ -n "$(printenv $1)" ]; then
|
if [ -n "$(printenv $1)" ]; then
|
||||||
echo "Expected secret $1 to be unset"
|
echo "Expected secret $1 to be unset"
|
||||||
|
|||||||
Reference in New Issue
Block a user