Skip to content

Commit d48c9cd

Browse files
authored
feat: more debugging, version printing (#68)
Signed-off-by: William Woodruff <[email protected]>
1 parent 1e232a0 commit d48c9cd

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.github/workflows/selftest.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
id: sigstore-python
3333
with:
3434
inputs: ./test/artifact.txt
35+
internal-be-careful-debug: true
3536
- name: Check outputs
3637
shell: bash
3738
run: |
@@ -55,6 +56,7 @@ jobs:
5556
id: sigstore-python
5657
with:
5758
inputs: ${{ matrix.input }}
59+
internal-be-careful-debug: true
5860
- name: Check failure
5961
env:
6062
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
@@ -75,6 +77,7 @@ jobs:
7577
with:
7678
inputs: ./test/artifact.txt
7779
staging: true
80+
internal-be-careful-debug: true
7881
- name: Check outputs
7982
run: |
8083
[[ -f ./test/artifact.txt.sigstore ]] || exit 1
@@ -90,6 +93,7 @@ jobs:
9093
with:
9194
inputs: ./test/*.txt
9295
staging: true
96+
internal-be-careful-debug: true
9397

9498
selftest-upload-artifacts:
9599
runs-on: ubuntu-latest
@@ -103,6 +107,7 @@ jobs:
103107
inputs: ./test/artifact.txt
104108
staging: true
105109
upload-signing-artifacts: true
110+
internal-be-careful-debug: true
106111
- uses: actions/download-artifact@v3
107112
with:
108113
name: "signing-artifacts-${{ github.job }}"
@@ -127,6 +132,7 @@ jobs:
127132
certificate: ./test/custom_certificate.crt
128133
bundle: ./test/custom_bundle.sigstore
129134
staging: true
135+
internal-be-careful-debug: true
130136
- name: Check outputs
131137
run: |
132138
[[ -f ./test/custom_signature.sig ]] || exit 1
@@ -147,6 +153,7 @@ jobs:
147153
verify-cert-identity: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
148154
verify-oidc-issuer: https://token.actions.githubusercontent.com
149155
staging: true
156+
internal-be-careful-debug: true
150157

151158
selftest-xfail-verify-missing-options:
152159
runs-on: ubuntu-latest
@@ -183,6 +190,8 @@ jobs:
183190
verify-oidc-issuer: ${{ matrix.config.verify-oidc-issuer }}
184191
verify-cert-identity: ${{ matrix.config.verify-cert-identity }}
185192
staging: true
193+
internal-be-careful-debug: true
194+
186195
- name: Check failure
187196
env:
188197
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
@@ -215,6 +224,7 @@ jobs:
215224
inputs: ./test/artifact.txt
216225
identity-token: ${{ steps.get-oidc-token.outputs.identity-token }}
217226
staging: true
227+
internal-be-careful-debug: true
218228

219229
all-selftests-pass:
220230
if: always()

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ runs:
102102
run: |
103103
# NOTE: Sourced, not executed as a script.
104104
source "${GITHUB_ACTION_PATH}/setup/setup.bash"
105+
env:
106+
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
105107
shell: bash
106108

107109
- name: Run sigstore-python

setup/setup.bash

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ die() {
2121
exit 1
2222
}
2323

24+
debug() {
25+
if [[ "${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG}" = "true" ]]; then
26+
echo -e "\033[93mDEBUG: ${1}\033[0m"
27+
fi
28+
}
29+
30+
debug "Python: $(python -V)"
31+
debug "pip: $(python -m pip --version)"
32+
2433
# NOTE: This file is meant to be sourced, not executed as a script.
2534
if [[ "${0}" == "${BASH_SOURCE[0]}" ]]; then
2635
die "Internal error: setup harness was executed instead of being sourced?"

0 commit comments

Comments
 (0)