chore(deps): update actions/github-script action to v7 #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: ['pull_request'] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Execute OPA Tests | |
id: opa | |
run: | | |
result=$(docker run --rm --workdir /github/workspace \ | |
-v $(pwd):/github/workspace \ | |
openpolicyagent/opa:0.17.2 \ | |
test policies/ -v || exit 0 ) | |
result="${result//'%'/'%25'}" | |
result="${result//$'\n'/'%0A'}" | |
result="${result//$'\r'/'%0D'}" | |
echo "::set-output name=result::$result" | |
- uses: actions/[email protected] | |
if: github.event_name == 'pull_request' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const output = `#### OPA Test Validation 🖌 \`${{ steps.opa.outcome }}\` | |
<details><summary>Show OPA Test Validation Report</summary> | |
\`\`\` | |
${{ steps.opa.outputs.result }} | |
\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`.\`, Workflow: \`${{ github.workflow }}\`*`; | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: output | |
}) |