Skip to content

Commit 29905fe

Browse files
authored
workflows: various CQA fixes (#1140)
* workflows: various CQA fixes * README: fix minor doc errors
1 parent a93adca commit 29905fe

File tree

10 files changed

+42
-17
lines changed

10 files changed

+42
-17
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
runs-on: ${{ matrix.conf.os }}
3232
steps:
3333
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
34+
with:
35+
persist-credentials: false
3436

3537
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
3638
with:
@@ -88,6 +90,8 @@ jobs:
8890

8991
steps:
9092
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
93+
with:
94+
persist-credentials: false
9195

9296
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
9397
with:

.github/workflows/conformance.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
15+
with:
16+
persist-credentials: false
1517

1618
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
1719
with:

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
13+
with:
14+
persist-credentials: false
1315

1416
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
1517
with:

.github/workflows/lint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
14+
with:
15+
persist-credentials: false
1416

1517
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
1618
with:
@@ -28,6 +30,8 @@ jobs:
2830
runs-on: ubuntu-latest
2931
steps:
3032
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
33+
with:
34+
persist-credentials: false
3135

3236
# NOTE: We intentionally check `--help` rendering against our minimum Python,
3337
# since it changes slightly between Python versions.
@@ -47,6 +51,9 @@ jobs:
4751
runs-on: ubuntu-latest
4852
steps:
4953
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
54+
with:
55+
persist-credentials: false
56+
5057
# adapted from Warehouse's bin/licenses
5158
- run: |
5259
for fn in $(find . -type f -name "*.py"); do
@@ -60,6 +67,8 @@ jobs:
6067
runs-on: ubuntu-latest
6168
steps:
6269
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
70+
with:
71+
persist-credentials: false
6372

6473
# NOTE: We intentionally check test certificates against our minimum supported Python.
6574
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0

.github/workflows/pin-requirements.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
# NOTE: Needed for `git describe` below.
3737
fetch-depth: 0
3838
fetch-tags: true
39+
# NOTE: Needed to push back to the repo.
40+
persist-credentials: true
3941

4042
- name: Get latest tag
4143
run: |
@@ -118,6 +120,8 @@ jobs:
118120
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
119121
with:
120122
ref: ${{ env.SIGSTORE_PIN_REQUIREMENTS_BRANCH }}
123+
# NOTE: Needed to push back to the repo.
124+
persist-credentials: true
121125

122126
- name: Reset remote PR branch
123127
run: |

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
hashes: ${{ steps.hash.outputs.hashes }}
1919
steps:
2020
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
21+
with:
22+
persist-credentials: false
2123

2224
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2325
with:

.github/workflows/requirements.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ jobs:
2929
- name: Populate reference from context
3030
if: ${{ env.SIGSTORE_REF == '' }}
3131
run: |
32-
echo "SIGSTORE_REF=${{ github.ref }}" >> "${GITHUB_ENV}"
32+
echo "SIGSTORE_REF=${GITHUB_REF}" >> "${GITHUB_ENV}"
3333
3434
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3535
with:
3636
ref: ${{ env.SIGSTORE_REF }}
37+
persist-credentials: false
3738

3839
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
3940
name: Install Python ${{ matrix.python_version }}

.github/workflows/scorecards-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
push:
99
branches: [ main ]
1010

11-
# Declare default permissions as read only.
12-
permissions: read-all
11+
# Clear default permissions.
12+
permissions: {}
1313

1414
jobs:
1515
analysis:

.github/workflows/staging-tests.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
name: Staging Instance Tests
22

3-
permissions:
4-
# Needed to access the workflow's OIDC identity.
5-
id-token: write
6-
7-
# Needed to create an issue, on failure.
8-
issues: write
9-
103
on:
114
push:
125
branches:
@@ -17,8 +10,16 @@ on:
1710
jobs:
1811
staging-tests:
1912
runs-on: ubuntu-latest
13+
permissions:
14+
# Needed to access the workflow's OIDC identity.
15+
id-token: write
16+
17+
# Needed to create an issue, on failure.
18+
issues: write
2019
steps:
2120
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
21+
with:
22+
persist-credentials: false
2223

2324
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2425
with:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ provided below.
358358

359359
### Signing with ambient credentials
360360

361-
For environments that support OpenID Connect, natively `sigstore` supports ambient credential
361+
For environments that support OpenID Connect, `sigstore` supports ambient credential
362362
detection. This includes many popular CI platforms and cloud providers. See the full list of
363363
supported environments [here](https://github.com/di/id#supported-environments).
364364

365365
Sign a single file (`foo.txt`) using an ambient OpenID Connect credential,
366-
saving the bundle to `foo.txt.sigstore`:
366+
saving the bundle to `foo.txt.sigstore.json`:
367367

368368
```console
369369
$ python -m sigstore sign foo.txt
@@ -376,7 +376,7 @@ allowing you to request signing certificates that attest to control over
376376
that email.
377377

378378
Sign a single file (`foo.txt`) using the OAuth2 flow, saving the
379-
bundle to `foo.txt.sigstore`:
379+
bundle to `foo.txt.sigstore.json`:
380380

381381
```console
382382
$ python -m sigstore sign foo.txt
@@ -404,11 +404,11 @@ namely the Fulcio's supported identity providers and the claims expected within
404404

405405
### Verifying against a signature and certificate
406406

407-
By default, `sigstore verify identity` will attempt to find a `<filename>.sigstore` in the
408-
same directory as the file being verified:
407+
By default, `sigstore verify identity` will attempt to find a `<filename>.sigstore.json`
408+
or `<filename>.sigstore` in the same directory as the file being verified:
409409

410410
```console
411-
# looks for foo.txt.sigstore
411+
# looks for foo.txt.sigstore.json
412412
$ python -m sigstore verify identity foo.txt \
413413
--cert-identity 'hamilcar@example.com' \
414414
--cert-oidc-issuer 'https://github.com/login/oauth'
@@ -417,7 +417,7 @@ $ python -m sigstore verify identity foo.txt \
417417
Multiple files can be verified at once:
418418

419419
```console
420-
# looks for {foo,bar}.txt.sigstore
420+
# looks for {foo,bar}.txt.sigstore.json
421421
$ python -m sigstore verify identity foo.txt bar.txt \
422422
--cert-identity 'hamilcar@example.com' \
423423
--cert-oidc-issuer 'https://github.com/login/oauth'

0 commit comments

Comments
 (0)