Repository navigation
feat(workflows): step 2, add reusable stale and Fabrica codegen checks #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
synackd
merged 8 commits into
seantronsen/release-400
from
seantronsen/feat/workflow-ports
Oct 12, 2026
+317
−0
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fc1468b
feat: create reusable workflow for actions/stale
seantronsen 82b021c
feat: add reusable workflow to check for drift with fabrica code gene…
seantronsen 095221e
fix: force fabrica regeneration
seantronsen c98a817
fix: switch to robust go.mod parsing
seantronsen e9cb5c9
fix: update fabrica ref selector to handle go pseudo-versioning
seantronsen c496d08
fix: address omitempty type for .Origin.Hash
seantronsen bba485a
feat: add lint-renovate based on https://github.com/OpenCHAMI/ochami/…
seantronsen 26eaa1c
chore: make zizmore happy
seantronsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # SPDX-FileCopyrightText: © 2026 OpenCHAMI a Series of LF Projects, LLC | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: lint-codegen-fabrica | ||
|
|
||
| # Reusable workflow that fails when a Fabrica project's committed generated | ||
| # code has drifted, by running the caller's `make generate-check` with a | ||
| # Fabrica built from source (passed as LOCAL_FABRICA). Fabrica stamps its | ||
| # version into generated code and only a source build carries that version; | ||
| # a `go run` build reports "dev" and always fails the check. | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| go-version: | ||
| description: 'Go version to use (e.g. "1.26.7", "stable"). Mutually exclusive with go-version-file.' | ||
| required: false | ||
| type: string | ||
| go-version-file: | ||
| description: 'Path to a go.mod or .go-version file containing the Go version. Mutually exclusive with go-version.' | ||
| required: false | ||
| type: string | ||
| fabrica-ref: | ||
| description: 'Fabrica tag, branch, or commit SHA to build (default: version in go.mod)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| permissions: | ||
| contents: read # baseline for checkout | ||
|
|
||
| jobs: | ||
| lint-codegen-fabrica: | ||
| runs-on: ubuntu-slim | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | ||
| with: | ||
| go-version: ${{ inputs.go-version || (inputs.go-version-file == '' && 'stable' || '') }} | ||
| go-version-file: ${{ inputs.go-version-file || '' }} | ||
|
|
||
| - name: Resolve Fabrica ref | ||
| id: fabrica-ref | ||
| env: | ||
| FABRICA_REF: ${{ inputs.fabrica-ref }} | ||
| run: | | ||
| version="$FABRICA_REF" | ||
| if [[ -z "$version" ]]; then | ||
| version=$(go mod edit -json | jq -r ' | ||
| .Require[]? | ||
| | select(.Path == "github.com/openchami/fabrica") | ||
| | .Version | ||
| ') | ||
| if [[ -z "$version" ]]; then | ||
| echo "::error::fabrica-ref not set and no github.com/openchami/fabrica version found in go.mod" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| # Resolve the tag, branch, commit, or pseudo-version to the commit it names | ||
| if ! ref=$(go list -mod=mod -m -json "github.com/openchami/fabrica@${version}" | | ||
| jq -er '.Origin.Hash | select(type == "string" and test("^[0-9a-f]{40}$"))'); then | ||
| echo "::error::Could not resolve Fabrica ref: ${version}" | ||
| exit 1 | ||
| fi | ||
| echo "Using Fabrica ref: ${ref}" | ||
| echo "ref=${ref}" >> "$GITHUB_OUTPUT" | ||
| - name: Checkout Fabrica | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: openchami/fabrica | ||
| ref: ${{ steps.fabrica-ref.outputs.ref }} | ||
| path: fabrica | ||
| fetch-depth: 0 # full history + tags so `git describe` stamps the same version as a local build | ||
| persist-credentials: false | ||
| - name: Build Fabrica | ||
| working-directory: fabrica | ||
| run: make build | ||
| - name: Verify generated code is committed | ||
| run: | | ||
| make generate-check \ | ||
| LOCAL_FABRICA="$GITHUB_WORKSPACE/fabrica" \ | ||
| FABRICA_SOURCE_ARG="--fabrica-source $GITHUB_WORKSPACE/fabrica --force" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # SPDX-FileCopyrightText: © 2026 OpenCHAMI a Series of LF Projects, LLC | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: lint-renovate | ||
|
|
||
| # Reusable workflow that validates the caller's Renovate config with | ||
| # renovate-config-validator. With no config-file, the validator checks every | ||
| # config file it finds in the repository (renovate.json, .github/renovate.json, | ||
| # renovate.json5, .renovaterc, ...). | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| renovate-version: | ||
| description: 'Renovate npm version that provides renovate-config-validator' | ||
| required: false | ||
| type: string | ||
| default: '44.115.13' | ||
| config-file: | ||
| description: 'Config file to validate (default: every Renovate config file found in the repo)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| permissions: | ||
| contents: read # baseline for checkout | ||
|
|
||
| jobs: | ||
| lint-renovate: | ||
| runs-on: ubuntu-slim | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version: '24' | ||
| - name: Validate Renovate config | ||
| env: | ||
| RENOVATE_VERSION: ${{ inputs.renovate-version }} | ||
| CONFIG_FILE: ${{ inputs.config-file }} | ||
| run: | | ||
| # --no-global: validate as repository config, not self-hosted config. | ||
| npx --yes --package "renovate@${RENOVATE_VERSION}" -- \ | ||
| renovate-config-validator --no-global ${CONFIG_FILE:+"$CONFIG_FILE"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # SPDX-FileCopyrightText: © 2026 OpenCHAMI a Series of LF Projects, LLC | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: stale | ||
|
|
||
| # Reusable workflow that marks and closes inactive issues and PRs with the | ||
| # org-default actions/stale policy. Callers own the schedule (a reusable | ||
| # workflow can't schedule itself). | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| days-before-stale: | ||
| description: 'Days of inactivity before an issue or PR is marked stale' | ||
| required: false | ||
| type: number | ||
| default: 35 | ||
| days-before-close: | ||
| description: 'Days after being marked stale before an issue or PR is closed' | ||
| required: false | ||
| type: number | ||
| default: 7 | ||
| stale-issue-label: | ||
| description: 'Label applied to stale issues' | ||
| required: false | ||
| type: string | ||
| default: 'stale' | ||
| stale-pr-label: | ||
| description: 'Label applied to stale PRs' | ||
| required: false | ||
| type: string | ||
| default: 'stale' | ||
| exempt-issue-labels: | ||
| description: 'Comma-separated labels that exempt an issue from going stale' | ||
| required: false | ||
| type: string | ||
| default: 'pinned,security,help wanted' | ||
| exempt-pr-labels: | ||
| description: 'Comma-separated labels that exempt a PR from going stale' | ||
| required: false | ||
| type: string | ||
| default: 'pinned,security' | ||
| operations-per-run: | ||
| description: 'Maximum GitHub API operations per run' | ||
| required: false | ||
| type: number | ||
| default: 500 | ||
| stale-issue-message: | ||
| description: 'Comment posted when an issue is marked stale' | ||
| required: false | ||
| type: string | ||
| default: >- | ||
| This issue has been automatically marked as stale due to inactivity. | ||
| Please add a comment or label to keep it open; otherwise it will close in 7 days. | ||
| close-issue-message: | ||
| description: 'Comment posted when a stale issue is closed' | ||
| required: false | ||
| type: string | ||
| default: 'Closing due to inactivity. Feel free to reopen with new information.' | ||
| stale-pr-message: | ||
| description: 'Comment posted when a PR is marked stale' | ||
| required: false | ||
| type: string | ||
| default: 'This PR has been marked stale due to inactivity. Comment or push changes to keep it open.' | ||
| close-pr-message: | ||
| description: 'Comment posted when a stale PR is closed' | ||
| required: false | ||
| type: string | ||
| default: 'Closing due to inactivity. Please reopen when it’s ready again.' | ||
|
|
||
| permissions: | ||
| issues: write # label, comment on, and close stale issues | ||
| pull-requests: write # label, comment on, and close stale PRs | ||
|
|
||
| jobs: | ||
| stale: | ||
| runs-on: ubuntu-slim | ||
| steps: | ||
| - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 | ||
| with: | ||
| days-before-stale: ${{ inputs.days-before-stale }} | ||
| days-before-close: ${{ inputs.days-before-close }} | ||
| stale-issue-label: ${{ inputs.stale-issue-label }} | ||
| stale-pr-label: ${{ inputs.stale-pr-label }} | ||
| exempt-issue-labels: ${{ inputs.exempt-issue-labels }} | ||
| exempt-pr-labels: ${{ inputs.exempt-pr-labels }} | ||
| operations-per-run: ${{ inputs.operations-per-run }} | ||
| remove-stale-when-updated: true | ||
| stale-issue-message: ${{ inputs.stale-issue-message }} | ||
| close-issue-message: ${{ inputs.close-issue-message }} | ||
| stale-pr-message: ${{ inputs.stale-pr-message }} | ||
| close-pr-message: ${{ inputs.close-pr-message }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.