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
91 changes: 5 additions & 86 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "CLA Assistant"
name: CLA

on:
issue_comment:
types: [created]
Expand All @@ -10,88 +11,6 @@ permissions:
statuses: write

jobs:
CLAAssistant:
runs-on: ubuntu-24.04
steps:
- name: Generate token from GitHub App
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: blacklanternsecurity

- name: Check all committers against org and allowlist
id: cla-check
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
PR_NUM="${{ github.event.pull_request.number }}"
else
PR_NUM="${{ github.event.issue.number }}"
fi

COMMITTERS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUM/commits" --paginate --jq '.[].author.login' | sort -u)
ALL_EXEMPT=true

for LOGIN in $COMMITTERS; do
# treat commits with no associated GitHub login as non-exempt
if [ -z "$LOGIN" ] || [ "$LOGIN" = "null" ]; then
echo "Unknown committer (no GitHub login) — not exempt"
ALL_EXEMPT=false
break
fi

EXEMPT=false

# check if account type is Bot (GitHub App accounts)
AUTHOR_TYPE=$(gh api "users/${LOGIN}" --jq '.type' 2>/dev/null || echo "Unknown")
if [ "$AUTHOR_TYPE" = "Bot" ]; then
echo "$LOGIN is a Bot account — exempt"
EXEMPT=true
fi

# check org membership
if [ "$EXEMPT" = "false" ]; then
if gh api "orgs/blacklanternsecurity/members/$LOGIN" > /dev/null 2>&1; then
echo "$LOGIN is an org member — exempt"
EXEMPT=true
fi
fi

if [ "$EXEMPT" = "false" ]; then
echo "$LOGIN is not exempt — CLA required"
ALL_EXEMPT=false
break
fi
done

echo "all_exempt=$ALL_EXEMPT" >> "$GITHUB_OUTPUT"

- name: Skip CLA when all committers are exempt
if: steps.cla-check.outputs.all_exempt == 'true' && github.event_name == 'pull_request_target'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api --method POST "repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \
-f state=success \
-f context="CLAAssistant" \
-f description="CLA check skipped — all committers are org members or bots"

- name: "CLA Assistant"
if: |
(steps.cla-check.outputs.all_exempt != 'true') &&
((github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target')
uses: contributor-assistant/github-action@v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
with:
path-to-signatures: "signatures/version1/cla.json"
path-to-document: "https://github.com/blacklanternsecurity/CLA/blob/main/ICLA.md"
branch: "main"
allowlist: "dependabot[bot],github-actions[bot],renovate[bot]"
remote-organization-name: "blacklanternsecurity"
remote-repository-name: "CLA"
lock-pullrequest-aftermerge: "false"
cla:
uses: blacklanternsecurity/CLA/.github/workflows/cla-reusable.yml@4f85d3c525483f0f846ef4384a8ece24a3c74375 # 2026-09-29
secrets: inherit
14 changes: 6 additions & 8 deletions .github/workflows/daily-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- cron: '0 6 * * *'
workflow_dispatch: # Allow manual trigger

permissions:
contents: read

# Prevent concurrent runs from racing to commit/merge
# cancel-in-progress: false means new runs wait instead of canceling in-progress ones
concurrency:
Expand All @@ -21,24 +24,19 @@ jobs:
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v3
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.CLOUDCHECK_APP_ID }}
private-key: ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }}

- name: Checkout stable branch
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: stable
token: ${{ steps.app-token.outputs.token }}

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0

- name: Install dependencies
run: uv sync
Expand Down
97 changes: 0 additions & 97 deletions .github/workflows/docker-tests.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/pipeline-tests.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish

on:
push:
tags: ["v*"]

permissions:
contents: read

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false

jobs:
check:
uses: blacklanternsecurity/CLA/.github/workflows/release-check.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows

tests:
needs: check
uses: ./.github/workflows/tests.yml

wheels:
needs: tests
uses: blacklanternsecurity/CLA/.github/workflows/maturin-wheels.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows
with:
# No s390x wheel has ever been published for cloudcheck.
targets: '{"linux": ["x86_64", "x86", "aarch64", "armv7", "ppc64le"], "musllinux": ["x86_64", "x86", "aarch64", "armv7"], "windows": ["x64", "x86"], "macos": ["x86_64", "aarch64"]}'
before-script-linux: scripts/wheel-container-setup.sh

crates:
needs: wheels
uses: blacklanternsecurity/CLA/.github/workflows/crates.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows
secrets:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

# Trusted publishing only matches a top-level job, so PyPI cannot move into a reusable workflow.
pypi:
needs: wheels
runs-on: ubuntu-24.04
environment: pypi
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: ${{ needs.wheels.outputs.artifacts }}
path: dist
merge-multiple: true
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: dist/*
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

docker:
needs: [check, wheels]
uses: blacklanternsecurity/CLA/.github/workflows/docker.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows
secrets: inherit
with:
image: ${{ github.repository }}
version: ${{ needs.check.outputs.version }}
prerelease: ${{ needs.check.outputs.prerelease }}
major: ${{ needs.check.outputs.major }}
minor: ${{ needs.check.outputs.minor }}

release:
needs: [check, wheels, crates, pypi, docker]
permissions:
contents: write
uses: blacklanternsecurity/CLA/.github/workflows/publish.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows
with:
version: ${{ needs.check.outputs.version }}
prerelease: ${{ needs.check.outputs.prerelease }}
images: ${{ needs.docker.outputs.images }}
artifacts: ${{ needs.wheels.outputs.artifacts }}
assets: dist/*
Loading
Loading