diff --git a/.github/workflows/selftest.yml b/.github/workflows/selftest.yml index 261a198..30d9805 100644 --- a/.github/workflows/selftest.yml +++ b/.github/workflows/selftest.yml @@ -22,7 +22,7 @@ jobs: internal-be-careful-allow-failure: true - name: assert expected output env: - PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}" + PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.summary-output-base64 }}" run: | grep -E 'pyyaml\s+\|\s+5.1' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}") @@ -41,7 +41,7 @@ jobs: internal-be-careful-allow-failure: true - name: assert expected output env: - PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}" + PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.summary-output-base64 }}" run: | grep -E 'pyyaml\s+\|\s+5.1' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}") @@ -67,7 +67,7 @@ jobs: internal-be-careful-allow-failure: true - name: assert expected output env: - PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}" + PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.summary-output-base64 }}" run: | grep -E 'pyyaml\s+\|\s+5.1' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}") @@ -85,9 +85,10 @@ jobs: internal-be-careful-allow-failure: true - name: assert expected output env: - PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}" + PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.summary-output-base64 }}" run: | grep -E 'pyyaml\s+\|\s+5.1' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}") + selftest-pipaudit-fail: runs-on: ubuntu-latest steps: @@ -103,6 +104,6 @@ jobs: internal-be-careful-allow-failure: true - name: assert expected output env: - PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}" + PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.summary-output-base64 }}" run: | grep 'pip-audit did not return any output' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}") diff --git a/README.md b/README.md index ff434ac..8e3fa5a 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,8 @@ The `summary` setting controls whether a GitHub [job summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/) is rendered at the end of the action. +__Note:__ The markdown-formatted summary is base64 wrapped and output to the variable `summary-output-base64` when job summaries are enabled. + Example: ```yaml diff --git a/action.yml b/action.yml index e5b3aec..0551bea 100644 --- a/action.yml +++ b/action.yml @@ -51,7 +51,7 @@ inputs: required: false default: "" outputs: - internal-be-careful-output: + summary-output-base64: description: "the column-formatted output from pip-audit, wrapped as base64" value: "${{ steps.pip-audit.outputs.output }}" runs: @@ -72,6 +72,10 @@ runs: source "${{ github.action_path }}/setup/venv.bash" python "${{ github.action_path }}/action.py" "${{ inputs.inputs }}" + + if [[ "${GHA_PIP_AUDIT_SUMMARY}" = "true" ]]; then + echo "markdown-summary=$(<${GITHUB_STEP_SUMMARY})" >> ${GITHUB_OUTPUT} + fi env: GHA_PIP_AUDIT_SUMMARY: "${{ inputs.summary }}" GHA_PIP_AUDIT_NO_DEPS: "${{ inputs.no-deps }}"