Skip to content

Commit

Permalink
GH Actions: various script tweaks
Browse files Browse the repository at this point in the history
Various tweaks to allow the scripts to pass the actionlint and shellcheck checks.
  • Loading branch information
jrfnl committed Jan 21, 2025
1 parent 2097663 commit 0bea12c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Start test server
run: |
PORT=8080 vendor/bin/start.sh
echo "REQUESTS_TEST_HOST_HTTP=localhost:8080" >> $GITHUB_ENV
echo "REQUESTS_TEST_HOST_HTTP=localhost:8080" >> "$GITHUB_ENV"
- name: Ping localhost domain
run: ping -c1 localhost
Expand All @@ -76,10 +76,10 @@ jobs:
run: |
PORT=9002 tests/utils/proxy/start.sh
PORT=9003 AUTH="test:pass" tests/utils/proxy/start.sh
echo "REQUESTS_HTTP_PROXY=localhost:9002" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH=localhost:9003" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY=localhost:9002" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH=localhost:9003" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> "$GITHUB_ENV"
- name: Ensure the HTTPS test instance on Render is spun up
run: curl -s -I https://requests-test-server.onrender.com/ > /dev/null
Expand All @@ -92,7 +92,7 @@ jobs:

- name: Grab PHPUnit version
id: phpunit_version
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"

- name: Run the unit tests (PHPUnit < 10)
if: ${{ ! startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Start test server
run: |
PORT=8080 vendor/bin/start.sh
echo "REQUESTS_TEST_HOST_HTTP=localhost:8080" >> $GITHUB_ENV
echo "REQUESTS_TEST_HOST_HTTP=localhost:8080" >> "$GITHUB_ENV"
- name: Ping localhost domain
run: ping -c1 localhost
Expand All @@ -100,10 +100,10 @@ jobs:
run: |
PORT=9002 tests/utils/proxy/start.sh
PORT=9003 AUTH="test:pass" tests/utils/proxy/start.sh
echo "REQUESTS_HTTP_PROXY=localhost:9002" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH=localhost:9003" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY=localhost:9002" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH=localhost:9003" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> "$GITHUB_ENV"
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> "$GITHUB_ENV"
- name: Ensure the HTTPS test instance on Render is spun up
run: curl -s -I https://requests-test-server.onrender.com/ > /dev/null
Expand All @@ -116,7 +116,7 @@ jobs:

- name: Grab PHPUnit version
id: phpunit_version
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"

- name: Run the unit tests, no code coverage (PHPUnit < 10)
if: ${{ matrix.coverage == false && ! startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/update-cacert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
PR_NUM: ${{ github.event.pull_request.number }}
run: |
if [[ "${{ github.event_name }}" == 'schedule' ]]; then
echo "BASE=develop" >> $GITHUB_OUTPUT
echo "PR_BRANCH=feature/auto-update-cacert" >> $GITHUB_OUTPUT
echo "BASE=develop" >> "$GITHUB_OUTPUT"
echo "PR_BRANCH=feature/auto-update-cacert" >> "$GITHUB_OUTPUT"
elif [[ "${{ github.event_name }}" == 'push' ]]; then
# Pull requests should always go to develop, even when triggered via a push to stable.
echo "BASE=develop" >> $GITHUB_OUTPUT
echo "PR_BRANCH=feature/auto-update-cacert" >> $GITHUB_OUTPUT
echo "BASE=develop" >> "$GITHUB_OUTPUT"
echo "PR_BRANCH=feature/auto-update-cacert" >> "$GITHUB_OUTPUT"
elif [[ $PR_NUM != '' ]]; then # = PR or manual (re-)run for a workflow triggered by a PR.
echo "BASE=$HEAD_REF" >> $GITHUB_OUTPUT
echo "PR_BRANCH=feature/auto-update-cacert-$PR_NUM" >> $GITHUB_OUTPUT
echo "BASE=$HEAD_REF" >> "$GITHUB_OUTPUT"
echo "PR_BRANCH=feature/auto-update-cacert-$PR_NUM" >> "$GITHUB_OUTPUT"
else # = manual run.
echo "BASE=$HEAD_REF" >> $GITHUB_OUTPUT
echo "PR_BRANCH=feature/auto-update-cacert-misc" >> $GITHUB_OUTPUT
echo "BASE=$HEAD_REF" >> "$GITHUB_OUTPUT"
echo "PR_BRANCH=feature/auto-update-cacert-misc" >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get date"
id: get-date
run: echo "DATE=$(/bin/date -u "+%F")" >> $GITHUB_OUTPUT
run: echo "DATE=$(/bin/date -u "+%F")" >> "$GITHUB_OUTPUT"

- name: Create pull request
uses: peter-evans/create-pull-request@v7
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/update-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
REF: ${{ github.ref }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH=$REF" >> $GITHUB_OUTPUT
echo "BRANCH=$REF" >> "$GITHUB_OUTPUT"
else
echo 'BRANCH=stable' >> $GITHUB_OUTPUT
echo 'BRANCH=stable' >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
Expand Down Expand Up @@ -101,15 +101,15 @@ jobs:
TAG_NAME: ${{ github.event.release.tag_name }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "REF=$REF_NAME" >> $GITHUB_OUTPUT
echo 'PR_TITLE_PREFIX=[TEST | DO NOT MERGE] ' >> $GITHUB_OUTPUT
echo 'PR_BODY=Test run for the website update after changes to the automated scripts.' >> $GITHUB_OUTPUT
echo 'DRAFT=always-true' >> $GITHUB_OUTPUT
echo "REF=$REF_NAME" >> "$GITHUB_OUTPUT"
echo 'PR_TITLE_PREFIX=[TEST | DO NOT MERGE] ' >> "$GITHUB_OUTPUT"
echo 'PR_BODY=Test run for the website update after changes to the automated scripts.' >> "$GITHUB_OUTPUT"
echo 'DRAFT=always-true' >> "$GITHUB_OUTPUT"
else
echo "REF=$TAG_NAME" >> $GITHUB_OUTPUT
echo 'PR_TITLE_PREFIX=' >> $GITHUB_OUTPUT
echo "PR_BODY=Website update after the release of Requests $TAG_NAME." >> $GITHUB_OUTPUT
echo 'DRAFT=false' >> $GITHUB_OUTPUT
echo "REF=$TAG_NAME" >> "$GITHUB_OUTPUT"
echo 'PR_TITLE_PREFIX=' >> "$GITHUB_OUTPUT"
echo "PR_BODY=Website update after the release of Requests $TAG_NAME." >> "$GITHUB_OUTPUT"
echo 'DRAFT=false' >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
Expand Down

0 comments on commit 0bea12c

Please sign in to comment.