Skip to content

Create GHA extract shell scripts action #20

Create GHA extract shell scripts action

Create GHA extract shell scripts action #20

---
name: Integration Tests
on:
pull_request:
paths:
- "action.yaml"
- "gha_extract_shell_scripts.py"
- ".github/workflows/integration-tests.yaml"
jobs:
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./
id: gha-extract-shell-scripts
- name: Test extracted
run: |
output_file="workflow_scripts/${{ env.workflow_file }}/job=Test/step=Test_extracted.sh"
if [[ ! -f "$output_file" ]]; then
find .
exit 1
fi
cat "$output_file"
echo "---"
sed 's/^\(expected\)=.*$/\1='\''\$\1'\''/' "$output_file"
echo "---"
diff --color=always <(sed 's/^\(expected\)=.*$/\1='\''\$\1'\''/' "$output_file") <(echo "$expected")
env:
expected: |
#!/usr/bin/env bash
set -e
# shellcheck disable=SC2034
expected='$expected'
# shellcheck disable=SC2034
workflow_file='integration-tests.yaml'
# ---
output_file="workflow_scripts/:env.workflow_file:/job=Test/step=Test_extracted.sh"
if [[ ! -f "$output_file" ]]; then
find .
exit 1
fi
diff --color=always <(sed 's/^\(expected\)=.*$/\1='\''\$\1'\''/' "$output_file") <(echo "$expected")
workflow_file: integration-tests.yaml