Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ updates:
- dependency-name: hashicorp/setup-terraform
- dependency-name: mxschmitt/action-tmate
# # Managed by cisagov/skeleton-aws-lambda-python
# - dependency-name: actions/attest
# - dependency-name: actions/upload-artifact
# - dependency-name: anchore/sbom-action
labels:
# dependabot default we need to replicate
- dependencies
Expand Down
135 changes: 135 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@ jobs:
- diagnostics
- lint
- test
permissions:
# Allows us to read the artifacts
actions: read
# Necessary to create the artifact storage record
artifact-metadata: write
attestations: write
# Allows us to add the SBOM to the release. Also,
# actions/checkout needs read permission to fetch code.
contents: read
# Allows the workflow to mint the OIDC token necessary to
# request a Sigstore signing certificate.
id-token: write
steps:
- name: Apply standard cisagov job preamble
uses: cisagov/action-job-preamble@v1
Expand Down Expand Up @@ -306,6 +318,129 @@ jobs:
with:
name: ${{ github.event.repository.name }}-${{ env.GH_SHORT_SHA }}
path: ${{ env.DEFAULT_ARTIFACT_NAME }}
- name: Create provenance attestation for Lambda deployment package
uses: actions/attest@v4
with:
subject-path: ${{ env.DEFAULT_ARTIFACT_NAME }}
- name: Setup tmate debug session
uses: mxschmitt/action-tmate@v3
if: env.RUN_TMATE
generate-sbom:
# Generate an SBOM from the Pipfile.lock file and, if there is a
# release, upload it as an asset to the release.
#
# This job is located in this workflow as opposed to a separate
# release workflow because it only makes sense to run it after the
Comment on lines +329 to +333

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

This job is described/named as uploading SBOMs to a release/pre-release, but the workflow is not triggered by release events and there is no step that actually uploads the generated SBOM to a GitHub release asset. Add an explicit conditional release-upload step (e.g., via gh release upload or a release action) and/or add an appropriate trigger/condition (tag push or on: release) so the intended behavior actually occurs.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I verified that the code works as is. See, e.g., this pre-release.

# build job. Putting it in a separate release workflow would

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does this need to run after the build job?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the build job fails then we probably don't care to create an SBOM.

# require us to introduce a dependency of the release workflow on
# this one.
#
# This if statement is present to keep the push and pull_request
# events from both causing the job to be run.
if: github.event_name != 'pull_request'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This workflow also runs on push, merge_group, and repository_dispatch. Is there a reason we want this job to run against all of those, but not on pull_request events?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't want it to run on pull_request because of the contents: write permission.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's probably worth adding a comment to that effect here.

@jsf9k jsf9k Jan 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I copied that from the build-push-all job from the build.yml workflow of cisagov/skeleton-docker but misunderstood why it was there. Please see commit f9ebf57.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That works for me, thanks.

name: Generate and upload SBOM
needs:
- build
- diagnostics
permissions:
# Allows us to read the SBOM artifact
actions: read
# Necessary to create the artifact storage record
artifact-metadata: write
attestations: write
# Allows us to add the SBOM to the release. Also,
# actions/checkout needs read permission to fetch code.
contents: write
Comment thread
jsf9k marked this conversation as resolved.
# Allows the workflow to mint the OIDC token necessary to
# request a Sigstore signing certificate.
id-token: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sbom-format:
- cyclonedx-json
- spdx-json
steps:
- name: Apply standard cisagov job preamble
uses: cisagov/action-job-preamble@v1
with:
# This functionality is poorly implemented and has been
# causing problems due to the MITM implementation hogging or
# leaking memory. As a result we disable it by default. If
# you want to temporarily enable it, simply set
# monitor_permissions equal to "true".
#
# TODO: Re-enable this functionality when practical. See
# cisagov/skeleton-docker#224 for more details.
monitor_permissions: "false"
# Use a variable to specify the permissions monitoring
# configuration. By default this will yield the
# configuration stored in the cisagov organization-level
# variable, but if you want to use a different configuration
# then simply:
# 1. Create a repository-level variable with the name
# ACTIONS_PERMISSIONS_CONFIG.
# 2. Set this new variable's value to the configuration you
# want to use for this repository.
#
# Note in particular that changing the permissions
# monitoring configuration *does not* require you to modify
# this workflow.
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
- id: setup-env
uses: cisagov/setup-env-github-action@v1
- uses: actions/checkout@v6
- id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ steps.setup-env.outputs.python-version }}
- uses: actions/cache@v5
env:
BASE_CACHE_KEY: >-
${{ github.job }}-${{
runner.os }}-${{ runner.arch }}-py${{
steps.setup-python.outputs.python-version }}-
with:
path: ${{ env.PIP_CACHE_DIR }}
key: >-
${{ env.BASE_CACHE_KEY }}${{
hashFiles('build/Pipfile.lock') }}
restore-keys: |
${{ env.BASE_CACHE_KEY }}
- name: Manipulate the repo name into the preferred format
id: manipulate-repo-name
run: |
NEW_NAME=$(echo "${{ github.repository}}" \
| tr '[:upper:]' '[:lower:]' \
| tr '/ ' '-')
echo "repo-name=${NEW_NAME}" >> $GITHUB_OUTPUT
- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
artifact-name: >-
${{ steps.manipulate-repo-name.outputs.repo-name }}.${{
matrix.sbom-format }}
file: build/Pipfile.lock
format: ${{ matrix.sbom-format }}
output-file: >-
${{ steps.manipulate-repo-name.outputs.repo-name }}.${{
matrix.sbom-format }}
- name: Create provenance attestation for SBOM
uses: actions/attest@v4
with:
subject-path: >-
${{ steps.manipulate-repo-name.outputs.repo-name }}.${{
matrix.sbom-format }}
- name: Download Lambda package artifact
uses: actions/download-artifact@v4
with:
name: lambda_build
path: build
- name: Create SBOM attestation for Lambda package
uses: actions/attest@v4
with:
sbom-path: >-
${{ steps.manipulate-repo-name.outputs.repo-name }}.${{
matrix.sbom-format }}
subject-path: build/lambda_build.zip
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ repos:

# GitHub Actions hooks
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
rev: 0.36.1
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand Down
53 changes: 0 additions & 53 deletions bump_version.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.3
0.1.0-rc.1
Comment thread
jsf9k marked this conversation as resolved.
Loading