Add test ensuring no breakage because of shell expansion

This commit is contained in:
Paul van Tilburg 2024-08-11 09:05:40 +02:00
parent 6ab7d41741
commit 9c0ac967a9
No known key found for this signature in database
GPG key ID: C6DE073EDA9EEC4D
2 changed files with 18 additions and 1 deletions

View file

@ -21,6 +21,17 @@ jobs:
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download forgejo-release "${{ steps.forgejo.outputs.token }}"
set -ex
export FORGEJO="${{ steps.forgejo.outputs.url }}"
curl --fail -sS $FORGEJO/api/v1/repos/testuser/upload-download/releases/tags/v2.0 > /tmp/release.json
EXPECTED='No shell expansion should on these notes:
- $(some_command)
- `other_commend`
- "double quoted" and '\''single quoted'\'' strings
- \backslash escape
- !exclamation_mark'
test "$EXPECTED" = "$(jq -r .body < /tmp/release.json)"
- name: testdata/upload-download-private
run: |
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"

View file

@ -36,7 +36,13 @@ jobs:
tag: v2.0
token: FORGEJO_TOKEN
release-dir: upload-dir-v2
release-notes: "RELEASE NOTES V2"
release-notes: |-
No shell expansion should on these notes:
- $(some_command)
- `other_commend`
- "double quoted" and 'single quoted' strings
- \backslash escape
- !exclamation_mark
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download