Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more debugging, version printing #68

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
id: sigstore-python
with:
inputs: ./test/artifact.txt
internal-be-careful-debug: true
- name: Check outputs
run: |
[[ -f ./test/artifact.txt.sigstore ]] || exit 1
Expand All @@ -44,6 +45,7 @@ jobs:
id: sigstore-python
with:
inputs: ${{ matrix.input }}
internal-be-careful-debug: true
- name: Check failure
env:
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
Expand All @@ -64,6 +66,7 @@ jobs:
with:
inputs: ./test/artifact.txt
staging: true
internal-be-careful-debug: true
- name: Check outputs
run: |
[[ -f ./test/artifact.txt.sigstore ]] || exit 1
Expand All @@ -79,6 +82,7 @@ jobs:
with:
inputs: ./test/*.txt
staging: true
internal-be-careful-debug: true

selftest-upload-artifacts:
runs-on: ubuntu-latest
Expand All @@ -92,6 +96,7 @@ jobs:
inputs: ./test/artifact.txt
staging: true
upload-signing-artifacts: true
internal-be-careful-debug: true
- uses: actions/download-artifact@v3
with:
name: "signing-artifacts-${{ github.job }}"
Expand All @@ -116,6 +121,7 @@ jobs:
certificate: ./test/custom_certificate.crt
bundle: ./test/custom_bundle.sigstore
staging: true
internal-be-careful-debug: true
- name: Check outputs
run: |
[[ -f ./test/custom_signature.sig ]] || exit 1
Expand All @@ -136,6 +142,7 @@ jobs:
verify-cert-identity: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
verify-oidc-issuer: https://token.actions.githubusercontent.com
staging: true
internal-be-careful-debug: true

selftest-xfail-verify-missing-options:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -172,6 +179,8 @@ jobs:
verify-oidc-issuer: ${{ matrix.config.verify-oidc-issuer }}
verify-cert-identity: ${{ matrix.config.verify-cert-identity }}
staging: true
internal-be-careful-debug: true

- name: Check failure
env:
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
Expand Down Expand Up @@ -204,6 +213,7 @@ jobs:
inputs: ./test/artifact.txt
identity-token: ${{ steps.get-oidc-token.outputs.identity-token }}
staging: true
internal-be-careful-debug: true

all-selftests-pass:
if: always()
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ runs:
run: |
# NOTE: Sourced, not executed as a script.
source "${{ github.action_path }}/setup/setup.bash"
env:
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
shell: bash

- name: Run sigstore-python
Expand Down
9 changes: 9 additions & 0 deletions setup/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ die() {
exit 1
}

debug() {
if [[ "${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG}" = "true" ]]; then
echo -e "\033[93mDEBUG: ${1}\033[0m"
fi
}

debug "Python: $(python -V)"
debug "pip: $(python -m pip --version)"

# NOTE: This file is meant to be sourced, not executed as a script.
if [[ "${0}" == "${BASH_SOURCE[0]}" ]]; then
die "Internal error: setup harness was executed instead of being sourced?"
Expand Down