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 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 @@ -32,6 +32,7 @@ jobs:
id: sigstore-python
with:
inputs: ./test/artifact.txt
internal-be-careful-debug: true
- name: Check outputs
shell: bash
run: |
Expand All @@ -55,6 +56,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 @@ -75,6 +77,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 @@ -90,6 +93,7 @@ jobs:
with:
inputs: ./test/*.txt
staging: true
internal-be-careful-debug: true

selftest-upload-artifacts:
runs-on: ubuntu-latest
Expand All @@ -103,6 +107,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 @@ -127,6 +132,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 @@ -147,6 +153,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 @@ -183,6 +190,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 @@ -215,6 +224,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