Skip to content

feat: add reusable Go CI workflows and composite actions - #1

Closed
sofiasimdianova wants to merge 3 commits into
mainfrom
feat/reusable-workflows
Closed

feat: add reusable Go CI workflows and composite actions#1
sofiasimdianova wants to merge 3 commits into
mainfrom
feat/reusable-workflows

Conversation

@sofiasimdianova

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (5)
  • .github/workflows/go-build.yml is excluded by !**/*.yml
  • .github/workflows/go-release.yml is excluded by !**/*.yml
  • .github/workflows/go-validate.yml is excluded by !**/*.yml
  • actions/setup-nix/action.yml is excluded by !**/*.yml
  • actions/setup-release/action.yml is excluded by !**/*.yml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 8e47b8e6-cb64-4a27-9398-0dae53d734c7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@NumaryBot

NumaryBot commented Jul 29, 2026

Copy link
Copy Markdown

🛑 Changes requested — automated review

This PR introduces reusable Go CI workflows and composite actions but has several functional issues that must be resolved before it is safe to merge for external consumers.

The most critical problem is the relative ./actions/setup-nix reference inside setup-release: when the action is invoked remotely, this path is resolved against the caller's repository, not this repo, causing an immediate failure for any consumer that does not replicate the directory structure. This must be replaced with a fully-qualified remote reference.

Four major issues also need attention: (1) The go-build workflow's job condition contains a trailing || (...) clause that unconditionally triggers the job on main, merge_group, or labeled PRs regardless of the build-condition input, making that input ineffective. (2) None of the reusable workflows declare their consumed secrets under on.workflow_call.secrets, so callers that cannot use secrets: inherit cannot pass secrets explicitly. (3) The PR title validation job in go-validate.yml is missing the pull-requests: read permission, which causes failures in repositories with restricted default token permissions. (4) The cache-priming nix develop step in setup-nix does not apply the nix-extra-flags input, so dev shells that require extra flags (e.g. --impure) fail before any build or test step runs.

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NumaryBot posted 2 new inline findings.

Summary: #1 (comment)

Comment thread actions/setup-release/action.yml
Comment thread .github/workflows/go-build.yml

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NumaryBot posted 5 new inline findings.

Summary: #1 (comment)

Comment thread actions/setup-release/action.yml
Comment thread .github/workflows/go-build.yml
Comment thread .github/workflows/go-build.yml
Comment thread .github/workflows/go-validate.yml
Comment thread actions/setup-nix/action.yml

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NumaryBot posted 5 new inline findings.

Summary: #1 (comment)

runs:
using: composite
steps:
- name: Setup Nix and Go caching

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 [blocker] Relative ./actions/setup-nix path breaks remote consumers

When setup-release is invoked as a remote action (e.g. formancehq/ci/actions/setup-release@main), the relative uses: ./actions/setup-nix is resolved against the caller's checked-out repository, not this action's directory. Any consumer that does not have an actions/setup-nix in their own repo will fail immediately.

Suggestion: Replace uses: ./actions/setup-nix with the fully-qualified remote reference, e.g. uses: formancehq/ci/actions/setup-nix@main, so it resolves correctly regardless of the caller's repository layout.

GoReleaser:
name: GoReleaser
runs-on: ${{ inputs.runner-profile }}
if: >-

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [major] Trailing || (...) clause overrides the build-condition input

The final || (github.ref == 'refs/heads/main' || ...) branch in the job condition makes the job unconditionally run on main, merge_group, or a labeled PR regardless of the build-condition value passed by callers. Setting build-condition: label-only still runs on every main/merge_group push, and main-only still runs on labeled PRs, making the input useless for restricting build mode.

Suggestion: Remove or integrate the unconditional fallback clause so that each branch of the condition is gated behind its corresponding build-condition value, e.g. using nested ternaries or a dedicated expression that respects the selected mode in all paths.

--command just ${{ inputs.build-target }}
${{ inputs.goreleaser-parallelism > 0 && format('--parallelism={0}', inputs.goreleaser-parallelism) || '' }}
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [major] Reusable workflow does not declare consumed secrets
reported by NumaryBot, codex

The workflow references secrets such as NUMARY_GITHUB_TOKEN, SPEAKEASY_API_KEY, FURY_TOKEN, and GORELEASER_KEY but has no on.workflow_call.secrets block. Callers that do not use secrets: inherit and instead pass secrets explicitly will have those calls rejected or receive empty secret values at runtime. The same issue applies to other reusable workflows in this PR that consume secrets.*.

Suggestion: Add a secrets: block under on.workflow_call declaring each secret the workflow consumes (with required: false where appropriate), and mirror the same pattern in the other reusable workflows.

if: inputs.enable-pr-check && github.event_name == 'pull_request'
name: PR
runs-on: ubuntu-latest
permissions:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [major] Missing pull-requests: read permission for PR title check

With explicit job-level permissions set, all unspecified scopes default to none. In repositories with restricted token permissions, amannn/action-semantic-pull-request cannot read pull request metadata without pull-requests: read, causing the title validation job to fail before it ever inspects the PR title.

Suggestion: Add pull-requests: read to the job's permissions block alongside any existing permissions such as statuses: write.

- name: Extract Go environment
id: go-env
shell: bash
run: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [major] Cache-priming nix develop step ignores nix-extra-flags
reported by NumaryBot, codex

The setup step runs a bare nix develop (with a hardcoded --impure) to seed the cache without applying the same extra flags passed via the nix-extra-flags input. Repositories whose dev shell requires those flags will fail during cache setup, before any build or test step runs.

Suggestion: Thread the nix-extra-flags input (and any hardcoded flags like --impure) into the cache-priming nix develop invocation so it uses the same flags as the actual build/test commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants