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

GH Actions: add shellcheck job + allow scripts to pass the new check #924

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,21 @@ jobs:
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml

shellcheck: #----------------------------------------------------------------------
name: 'ShellCheck'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up problem matcher
uses: lumaxis/shellcheck-problem-matchers@v2
with:
format: gcc

- name: Run ShellCheck
uses: ludeeus/[email protected]
with:
format: gcc
8 changes: 4 additions & 4 deletions tests/utils/proxy/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
PORT=${PORT:-9000}

PROXYBIN=${PROXYBIN:-"$(which mitmdump)"}
ARGS="-s '$PROXYDIR/proxy.py' -p $PORT"

Check warning on line 7 in tests/utils/proxy/start.sh

View workflow job for this annotation

GitHub Actions / ShellCheck

Quotes/backslashes will be treated literally. Use an array.

Check warning on line 7 in tests/utils/proxy/start.sh

View workflow job for this annotation

GitHub Actions / ShellCheck

Quotes/backslashes will be treated literally. Use an array.
if [[ ! -z "$AUTH" ]]; then
if [[ -n "$AUTH" ]]; then
ARGS="$ARGS --proxyauth $AUTH"
fi
PIDFILE="$PROXYDIR/proxy-$PORT.pid"

set -x

start-stop-daemon --verbose --start --background --pidfile $PIDFILE --make-pidfile --exec $PROXYBIN -- $ARGS
start-stop-daemon --verbose --start --background --pidfile "$PIDFILE" --make-pidfile --exec "$PROXYBIN" -- $ARGS

Check warning on line 15 in tests/utils/proxy/start.sh

View workflow job for this annotation

GitHub Actions / ShellCheck

Quotes/backslashes in this variable will not be respected.

Check warning on line 15 in tests/utils/proxy/start.sh

View workflow job for this annotation

GitHub Actions / ShellCheck

Quotes/backslashes in this variable will not be respected.

ps -p $(cat $PIDFILE) u
ps -p "$(cat "$PIDFILE")" u
sleep 2
ps -p $(cat $PIDFILE) u
ps -p "$(cat "$PIDFILE")" u
4 changes: 2 additions & 2 deletions tests/utils/proxy/stop.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

PROXYDIR="$PWD/$(dirname $0)"
PROXYDIR="$PWD/$(dirname "$0")"
PORT=${PORT:-9000}

PIDFILE="$PROXYDIR/proxy-$PORT.pid"

set -x

start-stop-daemon --verbose --stop --pidfile $PIDFILE --remove-pidfile
start-stop-daemon --verbose --stop --pidfile "$PIDFILE" --remove-pidfile
Loading