Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ jobs:
echo "::endgroup::"

- name: Block PR if critical tags found
if: steps.check-tags.outputs.rad_tags > 0
if: ${{ fromJSON(steps.check-tags.outputs.rad_tags) > 0 }}
run: |
echo "::error::PR blocked: Found ${{ steps.check-tags.outputs.rad_tags }} unverified production risk tags"
echo ""
Expand All @@ -336,7 +336,7 @@ jobs:
exit 1

- name: Fail on LLM tags (if configured)
if: inputs.fail-on-llm-tags && steps.check-tags.outputs.llm_tags > 0
if: ${{ inputs.fail-on-llm-tags && fromJSON(steps.check-tags.outputs.llm_tags) > 0 }}
run: |
echo "::error::PR blocked: Found ${{ steps.check-tags.outputs.llm_tags }} LLM debt tags"
echo ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ inputs.artifact-name }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ github.token }}
run-id: ${{ inputs.workflow-run-id }}
path: coverage/

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/python-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ on:
outputs:
matrix-result:
description: 'Overall matrix test result'
value: ${{ jobs.test-matrix.result }}
value: ${{ jobs.compatibility-summary.outputs.result }}

permissions:
contents: read
Expand Down Expand Up @@ -179,8 +179,14 @@ jobs:
needs: [build-matrix, test-matrix]
runs-on: ubuntu-latest
if: always()
outputs:
result: ${{ steps.result.outputs.result }}

steps:
- name: Set result output
id: result
run: echo "result=${{ needs.test-matrix.result }}" >> $GITHUB_OUTPUT

- name: Generate compatibility matrix summary
run: |
echo "## Python Compatibility Matrix Results" >> $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
const passed = '${{ steps.analyze.outputs.passed }}' === 'true';
const threshold = '${{ inputs.mutation-threshold }}';

const emoji = passed ? '' : '';
const emoji = passed ? '✅' : '⚠️';
const status = passed ? 'Passed' : 'Below Threshold';

const body = `## ${emoji} Mutation Testing Results
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
test:
name: Pre-Release Tests
runs-on: ubuntu-latest
if: inputs.run-tests
if: ${{ inputs.run-tests }}
timeout-minutes: 15
steps:
- name: Harden Runner
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
ls -lh dist/

- name: Generate SBOM
if: inputs.generate-sbom
if: ${{ inputs.generate-sbom }}
run: |
echo "Generating Software Bill of Materials..."
pip install cyclonedx-bom==4.6.1
Expand All @@ -212,7 +212,7 @@ jobs:

# Semantic Release Mode
- name: Python Semantic Release
if: inputs.semantic-release
if: ${{ inputs.semantic-release }}
id: semantic-release
uses: python-semantic-release/python-semantic-release@86e0ab1159fc51ecdc0cc2fb059530b285aab21f # v9.21.1
with:
Expand All @@ -222,14 +222,14 @@ jobs:
force: ${{ inputs.force-release }}

- name: Sign artifacts with Sigstore
if: inputs.sign-artifacts && (steps.semantic-release.outputs.released == 'true' || !inputs.semantic-release)
if: ${{ inputs.sign-artifacts && (steps.semantic-release.outputs.released == 'true' || !inputs.semantic-release) }}
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true

- name: Upload to GitHub Release (Semantic)
if: inputs.semantic-release && steps.semantic-release.outputs.released == 'true'
if: ${{ inputs.semantic-release && steps.semantic-release.outputs.released == 'true' }}
uses: python-semantic-release/publish-action@e821354c8e6d662b71478ac398ad3f38cb783692 # v9.21.1
with:
github_token: ${{ github.token }}
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
publish-pypi:
name: Publish to PyPI
needs: release
if: inputs.publish-to-pypi && (needs.release.outputs.released == 'true')
if: ${{ inputs.publish-to-pypi && (needs.release.outputs.released == 'true') }}
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/python-slsa.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# ============================================================================
# Reusable SLSA Provenance Workflow
# SLSA Provenance Workflow Template
# ============================================================================
# Generates SLSA Level 3 provenance attestations for Python packages
#
# Usage from downstream repos:
# IMPORTANT: This is a TEMPLATE, not a reusable workflow!
# GitHub Actions does not support nested reusable workflow calls.
# You must copy the 'provenance' job directly into your release workflow.
#
# Usage - Copy this job into your workflow:
# jobs:
# build:
# # First build your package and output base64-encoded hashes
# runs-on: ubuntu-latest
# outputs:
# hashes: ${{ steps.hash.outputs.hashes }}
# steps:
Expand All @@ -20,26 +24,40 @@
# name: dist
# path: dist/
#
# # Copy this job directly into your workflow
# provenance:
# needs: build
# uses: ByronWilliamsCPA/.github/.github/workflows/python-slsa.yml@main
# with:
# base64-subjects: ${{ needs.build.outputs.hashes }}
# permissions:
# actions: read
# id-token: write
# contents: write
# uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
# with:
# base64-subjects: ${{ needs.build.outputs.hashes }}
# upload-assets: true
# upload-tag-name: ${{ github.ref_name }}
# provenance-name: multiple.intoto.jsonl
#
# Features:
# - SLSA Level 3 provenance generation
# - Supply chain security attestations
# - Automatic release artifact attachment
#
# Why can't this be a reusable workflow?
# GitHub Actions doesn't allow reusable workflows to call other reusable
# workflows. Since SLSA provenance requires calling the official
# slsa-framework generator (which is itself a reusable workflow),
# you must call it directly from your workflow.
#
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations
# ============================================================================

name: SLSA Provenance (Reusable)
name: SLSA Provenance (Template)

# This workflow demonstrates SLSA provenance generation
# It can be triggered manually for testing or referenced as a template
on:
workflow_call:
workflow_dispatch:
inputs:
base64-subjects:
description: 'Base64-encoded SHA256 hashes of artifacts (sha256sum * | base64 -w0)'
Expand Down Expand Up @@ -72,7 +90,7 @@ permissions:
jobs:
provenance:
name: Generate SLSA Provenance
# Use the official SLSA generator
# Use the official SLSA generator directly
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with:
base64-subjects: ${{ inputs.base64-subjects }}
Expand Down