Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
- main
pull_request:

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ on:

name: release

permissions:
# Used to sign the release's artifacts with sigstore-python.
id-token: write

# Used to attach signing artifacts to the published release.
contents: write
permissions: {}

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write # Used to sign the artifacts.
contents: write # Used to attach signing artifacts to the release.

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/schedule-selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ name: Scheduled self-test

on:
schedule:
- cron: '0 12 * * *' # Every day at 1200 UTC
- cron: "0 12 * * *" # Every day at 1200 UTC

permissions: {}

jobs:
run-selftests:
permissions:
id-token: write
id-token: write # for OIDC in selftest

uses: ./.github/workflows/selftest.yml
open-issue:
permissions:
issues: write
issues: write # for opening the issue

runs-on: ubuntu-latest
if: ${{ failure() }}
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions: {}
jobs:
selftest:
permissions:
id-token: write
id-token: write # selftest
strategy:
matrix:
os:
Expand All @@ -25,10 +25,10 @@ jobs:
runs-on: ${{ matrix.os }}
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
if: ${{ matrix.os != 'ubuntu-latest' }}
with:
python-version: "3.x"
Expand All @@ -45,7 +45,7 @@ jobs:

selftest-runner-python:
permissions:
id-token: write
id-token: write # selftest
strategy:
matrix:
os:
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: ${{ matrix.os }}
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -71,7 +71,7 @@ jobs:

selftest-whitespace:
permissions:
id-token: write
id-token: write # selftest
strategy:
matrix:
os:
Expand All @@ -81,10 +81,10 @@ jobs:
runs-on: ${{ matrix.os }}
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
if: ${{ matrix.os != 'ubuntu-latest' }}
with:
python-version: "3.x"
Expand All @@ -106,7 +106,7 @@ jobs:

selftest-xfail-invalid-inputs:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -117,7 +117,7 @@ jobs:
- "/tmp/extremely-nonexistent-file"
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -138,11 +138,11 @@ jobs:

selftest-staging:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -158,11 +158,11 @@ jobs:

selftest-glob:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifacts and publish signatures
Expand All @@ -180,13 +180,13 @@ jobs:

selftest-xfail-glob-input-expansion:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
env:
TEST_DIR: test
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifacts and publish signatures
Expand All @@ -210,11 +210,11 @@ jobs:

selftest-glob-multiple:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifacts and publish signatures
Expand All @@ -237,11 +237,11 @@ jobs:

selftest-upload-artifacts:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -252,7 +252,7 @@ jobs:
staging: true
upload-signing-artifacts: true
internal-be-careful-debug: true
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: "signing-artifacts-${{ github.job }}"
path: ./test/uploaded
Expand All @@ -264,11 +264,11 @@ jobs:

selftest-verify:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -284,7 +284,7 @@ jobs:

selftest-xfail-verify-missing-options:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -308,7 +308,7 @@ jobs:

if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Sign artifact and publish signature
Expand All @@ -334,11 +334,11 @@ jobs:

selftest-identity-token:
permissions:
id-token: write
id-token: write # selftest
runs-on: ubuntu-latest
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Get OIDC token
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ on:
pull_request: {}
push:
branches:
- main
- master
- main
- master
paths:
- .github/workflows/semgrep.yml
- .github/workflows/semgrep.yml
schedule:
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"

permissions: {}

name: Semgrep

jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: semgrep/semgrep
image: semgrep/semgrep:1.138.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I pinned this based on https://hub.docker.com/r/semgrep/semgrep/tags, but we should really be fully hash-pinning this. Unfortunately, I don't think any tools do a great job of updating Docker image references in GHA (maybe zizmor should).

Alternatively, I think we could remove this workflow entirely -- IMO Semgrep hasn't provided a ton of value in this repo, and I honestly can't remember why we added it 😅


steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- run: semgrep ci
9 changes: 4 additions & 5 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ on:
pull_request:
branches: ["**"]

permissions: {}

jobs:
zizmor:
name: zizmor latest via PyPI
runs-on: ubuntu-latest
permissions:
security-events: write
# required for workflows in private repositories
contents: read
actions: read
security-events: write # for uploading the sarif file
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ runs:
GHA_SIGSTORE_PYTHON_INPUTS: "${{ inputs.inputs }}"
shell: bash

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: inputs.upload-signing-artifacts == 'true'
with:
name: "signing-artifacts-${{ github.job }}"
Expand Down
Loading