Skip to content

Commit 80f5a47

Browse files
Jan Chren ~rindealrindeal
Jan Chren ~rindeal
authored andcommitted
use standard GitHub Actions debugging
I don't see the need for wheel reinvention. https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging Signed-off-by: Jan Chren ~rindeal <[email protected]>
1 parent f514d46 commit 80f5a47

File tree

5 files changed

+3
-51
lines changed

5 files changed

+3
-51
lines changed

.github/workflows/selftest.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
id: sigstore-python
3535
with:
3636
inputs: ./test/artifact.txt
37-
internal-be-careful-debug: true
3837
- name: Check outputs
3938
shell: bash
4039
run: |
@@ -56,7 +55,6 @@ jobs:
5655
id: sigstore-python
5756
with:
5857
inputs: ./test/artifact.txt
59-
internal-be-careful-debug: true
6058
- name: Check outputs
6159
shell: bash
6260
run: |
@@ -85,7 +83,6 @@ jobs:
8583
./test/artifact.txt
8684
./test/white\ space.txt
8785
./test/"more white space.txt"
88-
internal-be-careful-debug: true
8986
- name: Check outputs
9087
shell: bash
9188
run: |
@@ -111,7 +108,6 @@ jobs:
111108
id: sigstore-python
112109
with:
113110
inputs: ${{ matrix.input }}
114-
internal-be-careful-debug: true
115111
- name: Check failure
116112
env:
117113
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
@@ -132,7 +128,6 @@ jobs:
132128
with:
133129
inputs: ./test/artifact.txt
134130
staging: true
135-
internal-be-careful-debug: true
136131
- name: Check outputs
137132
run: |
138133
[[ -f ./test/artifact.txt.sigstore.json ]] || exit 1
@@ -148,7 +143,6 @@ jobs:
148143
with:
149144
inputs: ./test/*.txt
150145
staging: true
151-
internal-be-careful-debug: true
152146
- name: Check outputs
153147
run: |
154148
[[ -f ./test/artifact.txt.sigstore.json ]] || exit 1
@@ -171,7 +165,6 @@ jobs:
171165
# the user should have to pre-expand it for us.
172166
inputs: ./${TEST_DIR}/*.txt
173167
staging: true
174-
internal-be-careful-debug: true
175168
- name: Check failure
176169
env:
177170
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
@@ -192,7 +185,6 @@ jobs:
192185
with:
193186
inputs: ./test/artifact*.txt ./test/another*.txt ./test/subdir/*.txt
194187
staging: true
195-
internal-be-careful-debug: true
196188
- name: Check outputs
197189
run: |
198190
[[ -f ./test/artifact.txt.sigstore.json ]] || exit 1
@@ -216,7 +208,6 @@ jobs:
216208
inputs: ./test/artifact.txt
217209
staging: true
218210
upload-signing-artifacts: true
219-
internal-be-careful-debug: true
220211
- uses: actions/download-artifact@v4
221212
with:
222213
name: "signing-artifacts-${{ github.job }}"
@@ -241,7 +232,6 @@ jobs:
241232
verify-cert-identity: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
242233
verify-oidc-issuer: https://token.actions.githubusercontent.com
243234
staging: true
244-
internal-be-careful-debug: true
245235

246236
selftest-xfail-verify-missing-options:
247237
runs-on: ubuntu-latest
@@ -278,7 +268,6 @@ jobs:
278268
verify-oidc-issuer: ${{ matrix.config.verify-oidc-issuer }}
279269
verify-cert-identity: ${{ matrix.config.verify-cert-identity }}
280270
staging: true
281-
internal-be-careful-debug: true
282271

283272
- name: Check failure
284273
env:
@@ -312,7 +301,6 @@ jobs:
312301
inputs: ./test/artifact.txt
313302
identity-token: ${{ steps.get-oidc-token.outputs.identity-token }}
314303
staging: true
315-
internal-be-careful-debug: true
316304

317305
all-selftests-pass:
318306
if: always()

README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -277,35 +277,6 @@ permissions:
277277
- uses: sigstore/[email protected]
278278
```
279279

280-
### Internal options
281-
<details>
282-
<summary>⚠️ Internal options ⚠️</summary>
283-
284-
Everything below is considered "internal," which means that it
285-
isn't part of the stable public settings and may be removed or changed at
286-
any points. **You probably do not need these settings.**
287-
288-
All internal options are prefixed with `internal-be-careful-`.
289-
290-
#### `internal-be-careful-debug`
291-
292-
**Default**: `false`
293-
294-
The `internal-be-careful-debug` setting enables additional debug logs,
295-
both within `sigstore-python` itself and the action's harness code. You can
296-
use it to debug troublesome configurations.
297-
298-
Example:
299-
300-
```yaml
301-
- uses: sigstore/[email protected]
302-
with:
303-
inputs: file.txt
304-
internal-be-careful-debug: true
305-
```
306-
307-
</details>
308-
309280
## Licensing
310281

311282
`gh-action-sigstore-python` is licensed under the Apache 2.0 License.

action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
_SUMMARY = Path(_summary_path).open("a")
3838

3939
_RENDER_SUMMARY = os.getenv("GHA_SIGSTORE_PYTHON_SUMMARY", "true") == "true"
40-
_DEBUG = os.getenv("GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG", "false") != "false"
40+
_DEBUG = os.getenv("ACTIONS_STEP_DEBUG", "false") == "true"
4141

4242
_RELEASE_SIGNING_ARTIFACTS = (
4343
os.getenv("GHA_SIGSTORE_PYTHON_RELEASE_SIGNING_ARTIFACTS", "true") == "true"

action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ inputs:
6262
description: "attach all signing artifacts as release assets"
6363
required: false
6464
default: "true"
65-
internal-be-careful-debug:
66-
description: "run with debug logs (default false)"
67-
required: false
68-
default: "false"
6965

7066
runs:
7167
using: "composite"
@@ -75,8 +71,6 @@ runs:
7571
run: |
7672
# NOTE: Sourced, not executed as a script.
7773
source "${GITHUB_ACTION_PATH}/setup/setup.bash"
78-
env:
79-
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
8074
shell: bash
8175

8276
- name: Run sigstore-python
@@ -97,7 +91,6 @@ runs:
9791
GHA_SIGSTORE_PYTHON_VERIFY_CERT_IDENTITY: "${{ inputs.verify-cert-identity }}"
9892
GHA_SIGSTORE_PYTHON_VERIFY_OIDC_ISSUER: "${{ inputs.verify-oidc-issuer }}"
9993
GHA_SIGSTORE_PYTHON_RELEASE_SIGNING_ARTIFACTS: "${{ inputs.release-signing-artifacts }}"
100-
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
10194
GHA_SIGSTORE_PYTHON_INPUTS: "${{ inputs.inputs }}"
10295
shell: bash
10396

setup/setup.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ die() {
2222
}
2323

2424
debug() {
25-
if [[ "${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG}" = "true" ]]; then
26-
echo -e "\033[93mDEBUG: ${1}\033[0m"
25+
if [[ "${ACTIONS_STEP_DEBUG}" == "true" ]]; then
26+
echo "::debug::${*}"
2727
fi
2828
}
2929

0 commit comments

Comments
 (0)