Skip to content

Add configurable allowed-bot-users workflow input#229

Merged
strawgate merged 4 commits intomainfrom
main-a6a2034248ea35ef
Feb 20, 2026
Merged

Add configurable allowed-bot-users workflow input#229
strawgate merged 4 commits intomainfrom
main-a6a2034248ea35ef

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 20, 2026

Summary

  • Add a configurable allowed-bot-users workflow input to all 31 agent workflows, enabling callers to allowlist bot actors that can trigger workflows
  • Default value is github-actions[bot]; accepts comma-separated usernames for multiple bots (e.g. github-actions[bot],dependabot[bot])
  • Wire bots: field under on: to ${{ inputs.allowed-bot-users }} so the pre-activation check_membership step respects the caller's configuration
  • upgrade-check (standalone schedule/dispatch, no workflow_call) uses a hardcoded bots: entry instead
  • Update all 30 workflow README docs with the new input

How it works

The bots: frontmatter field compiles into GH_AW_ALLOWED_BOTS in the lock file's pre-activation job. This follows the same comma-separated pattern as GH_AW_REQUIRED_ROLES — the check_membership.cjs runtime splits the value and checks if github.actor matches any entry.

Test plan

  • All 31 workflows compile without errors
  • Verified GH_AW_ALLOWED_BOTS: ${{ inputs.allowed-bot-users }} present in all 30 workflow_call lock files
  • upgrade-check lock file correctly omits membership check (schedule-only)
  • Deploy to a test repo and verify a bot-authored PR triggers pr-review successfully

Fixes #227

Summary by CodeRabbit

  • New Features
    • Added allowed-bot-users configuration input to all GitHub agent workflows, enabling customization of allowlisted bot actors across automated workflows (defaults to github-actions[bot])

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request introduces a new workflow input parameter allowed-bot-users across all GitHub Actions agent workflows (.lock.yml, .md templates, and README documentation). The input accepts a comma-separated list of bot actor usernames (default: github-actions[bot]) and propagates it through workflow steps via the GH_AW_ALLOWED_BOTS environment variable.

Changes

Cohort / File(s) Summary
Workflow Lock Files
.github/workflows/gh-aw-*.lock.yml
Added new allowed-bot-users input to workflow_call inputs; propagated to GH_AW_ALLOWED_BOTS environment variable in activation and pre-activation steps; updated frontmatter metadata hash.
Workflow Markdown Templates
.github/workflows/gh-aw-*.md
Added new allowed-bot-users input to workflow_call.inputs; introduced new bots section referencing the input via ${{ inputs.allowed-bot-users }}.
README Documentation
gh-agent-workflows/*/README.md
Updated Inputs tables across all workflows to document the new allowed-bot-users parameter with description and default value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Whiskers twitching with glee,
A new input we see—bots customizable, free!
From efficiency to bugs, each workflow's aware,
Of allowed-bot-users everywhere!
Hop along, little bots, in your rightful place! 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main-a6a2034248ea35ef

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@github/workflows/gh-aw-pr-review.md`:
- Around line 32-36: The workflows use a single YAML string input
"allowed-bot-users" which is being treated as one array element when converted
to "bots"; update each workflow to accept a JSON array string and parse it with
fromJSON rather than relying on CSV parsing: change the usage that populates the
"bots" input to use fromJSON(inputs.allowed-bot-users) (e.g., where "bots" is
set) and update callers to pass a JSON array like '["bot1[bot]","bot2[bot]"]';
alternatively, if you must accept comma-separated values, add a preprocessing
shell step that splits inputs.allowed-bot-users into individual entries and
passes the resulting array to downstream steps instead of leaving "bots" as a
single CSV string — apply this fix for the referenced workflows that define or
use the allowed-bot-users input and the "bots" field.

github-actions bot and others added 3 commits February 20, 2026 17:19
Add proposed workflow shim copies under github/workflows with a new `allowed-bot-users` workflow_call input and wire bot allowlists to `${{ inputs.allowed-bot-users }}`. Update corresponding workflow READMEs to document the new input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate lock files so GH_AW_ALLOWED_BOTS uses the
${{ inputs.allowed-bot-users }} expression at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
@strawgate strawgate force-pushed the main-a6a2034248ea35ef branch from acf0c3a to 5f1111d Compare February 20, 2026 23:23
Extend the configurable bot allowlist to all 31 workflows (not just
the original 6). Since these are all reusable workflows, callers
control the trigger events and any of them could be wired to
interactive events where a bot is the actor.

- 30 workflow_call workflows: add `allowed-bot-users` input with
  default `github-actions[bot]` and wire `bots:` to the input
- 1 standalone workflow (upgrade-check): add hardcoded `bots:` entry
- Update all 24 READMEs with the new input documentation
- Recompile all lock files

Co-authored-by: Cursor <cursoragent@cursor.com>
@strawgate strawgate marked this pull request as ready for review February 20, 2026 23:35
Copy link
Contributor Author

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

APPROVE — I found no blocking issues in this PR.


What is this? | From workflow: PR Review Agent

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #229

@strawgate strawgate merged commit d70adec into main Feb 20, 2026
12 checks passed
@strawgate strawgate deleted the main-a6a2034248ea35ef branch February 20, 2026 23:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/gh-aw-upgrade-check.lock.yml (1)

425-426: ⚠️ Potential issue | 🟡 Minor

Pre-existing issue: References to non-existent job outputs.

These environment variables reference needs.pre_activation.outputs, but there is no pre_activation job defined in this workflow. While this wasn't introduced by the current PR, these references will resolve to empty values at runtime.

Consider either:

  • Removing these unused environment variable assignments
  • Adding the missing pre_activation job if bot/role checking is intended
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-upgrade-check.lock.yml around lines 425 - 426, The
workflow sets environment vars GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED and
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND from
needs.pre_activation.outputs but there is no pre_activation job; either remove
these environment assignments or add a pre_activation job that exposes outputs
activated and matched_command so the values resolve; locate the
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED /
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND entries and either delete
them or implement a pre_activation job that sets outputs.
.github/workflows/gh-aw-breaking-change-detect.md (1)

29-44: ⚠️ Potential issue | 🟠 Major

Split allowed-bot-users into a YAML list for the bots field.

The bots field expects a YAML list of discrete bot usernames (e.g., ["bot1[bot]", "bot2[bot]"]), but currently wraps the entire allowed-bot-users input as a single string item. If multiple comma-separated bots are provided (e.g., "github-actions[bot],dependabot[bot]"), the entire string will be treated as one username and fail to match. Either split the CSV string using a shell step or change the input to accept a JSON array format directly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-breaking-change-detect.md around lines 29 - 44, The
bots field is receiving the entire inputs.allowed-bot-users string as a single
list item so comma-separated usernames won't be recognized; update the workflow
to provide bots as a real YAML/JSON array instead of a single string by either
(A) changing the allowed-bot-users input to accept a JSON array and pass that
array into the bots field, or (B) add a step that splits the CSV from
inputs.allowed-bot-users into an actual array (e.g., using a shell or action to
convert CSV → JSON array) and then set that array into the bots field; reference
the inputs.allowed-bot-users input and the bots field in your change so the
workflow consumes discrete usernames rather than one concatenated string.
🧹 Nitpick comments (1)
.github/workflows/gh-aw-downstream-health.md (1)

98-101: Keep the prompt consistent with configurable bot input.

The prompt hardcodes github-actions[bot]. If callers customize allowed-bot-users, the agent instructions become outdated. Consider parameterizing the prompt text or referencing the input explicitly.

♻️ Suggested tweak
-   Look for recent comments and PR reviews by `github-actions[bot]` in the last 24 hours:
-   - Use `github-search_issues` with query: `repo:{owner}/{repo} commenter:github-actions[bot] updated:>={date}`
-   - Use `github-search_pull_requests` with query: `repo:{owner}/{repo} reviewed-by:github-actions[bot] updated:>={date}`
+   Look for recent comments and PR reviews by allowed bots in the last 24 hours (from `allowed-bot-users`):
+   - Use `github-search_issues` with query: `repo:{owner}/{repo} commenter:{bot} updated:>={date}`
+   - Use `github-search_pull_requests` with query: `repo:{owner}/{repo} reviewed-by:{bot} updated:>={date}`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-downstream-health.md around lines 98 - 101, Replace
the hardcoded "github-actions[bot]" in the two search queries with the
configurable bot input (e.g., the variable or input representing allowed bot
users such as allowed-bot-users or inputs.allowed_bot_users) so the prompt
builds queries dynamically; update the lines that construct the
github-search_issues and github-search_pull_requests queries to interpolate that
variable (or reference the input explicitly) instead of the literal
"github-actions[bot]" so callers who customize allowed-bot-users are respected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/gh-aw-upgrade-check.lock.yml:
- Around line 40-41: The commented notes about a "pre_activation" job and the
commented-out bots configuration are misleading because this workflow only
defines the jobs activation, agent, conclusion, detection, and safe_outputs;
either remove those comment lines entirely to avoid confusion or add a hardcoded
bots: entry for the standalone upgrade-check workflow (e.g., include bots: [
"github-actions[bot]" ]) in the workflow inputs/top-level config as described in
the PR; update the comment or code near the existing commented lines so they
accurately reflect the actual jobs (activation, agent, conclusion, detection,
safe_outputs) and the chosen approach (remove comments if bot checking is not
used, or enable the bots entry if required).

---

Outside diff comments:
In @.github/workflows/gh-aw-breaking-change-detect.md:
- Around line 29-44: The bots field is receiving the entire
inputs.allowed-bot-users string as a single list item so comma-separated
usernames won't be recognized; update the workflow to provide bots as a real
YAML/JSON array instead of a single string by either (A) changing the
allowed-bot-users input to accept a JSON array and pass that array into the bots
field, or (B) add a step that splits the CSV from inputs.allowed-bot-users into
an actual array (e.g., using a shell or action to convert CSV → JSON array) and
then set that array into the bots field; reference the inputs.allowed-bot-users
input and the bots field in your change so the workflow consumes discrete
usernames rather than one concatenated string.

In @.github/workflows/gh-aw-upgrade-check.lock.yml:
- Around line 425-426: The workflow sets environment vars
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED and
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND from
needs.pre_activation.outputs but there is no pre_activation job; either remove
these environment assignments or add a pre_activation job that exposes outputs
activated and matched_command so the values resolve; locate the
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED /
GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND entries and either delete
them or implement a pre_activation job that sets outputs.

---

Duplicate comments:
In @.github/workflows/gh-aw-agent-suggestions.md:
- Around line 28-43: The workflow currently passes the comma-separated string
input "allowed-bot-users" directly into the "bots" list which yields a single
CSV string entry instead of an array; update the template so the "bots" value is
an actual array by splitting the "inputs.allowed-bot-users" CSV on commas,
trimming whitespace, and omitting empty entries before expanding into the "bots"
array (i.e. transform inputs.allowed-bot-users -> an array and use that array
for bots); reference the "allowed-bot-users" input and the "bots" key when
making the change.

In @.github/workflows/gh-aw-bug-hunter.md:
- Around line 43-44: The `bots` entry currently uses a single array element "${{
inputs.allowed-bot-users }}", which will register the entire input string as one
bot; update the workflow so multiple bot usernames are expanded: either parse
the comma-separated input into separate array elements (split the
inputs.allowed-bot-users value on commas/whitespace and emit each trimmed
username as its own array item for `bots`) or change the input to a
multi-line/matrix style and iterate over each line as an array element; locate
the `bots` key and the `inputs.allowed-bot-users` reference in the workflow and
implement the chosen parsing/iteration approach so multiple bots are registered
correctly.

In @.github/workflows/gh-aw-docs-drift-external.md:
- Around line 29-49: The CSV allowlist in the workflow uses the single string
input inputs.allowed-bot-users and then injects it directly into the bots array,
which will fail when multiple comma-separated bot names are provided; change the
input to accept a YAML/JSON array or split-and-trim the allowed-bot-users string
before populating the bots list. Specifically, update the workflow to either (a)
make allowed-bot-users a multiline/array input and feed that into the bots key,
or (b) add a step that parses inputs.allowed-bot-users by splitting on commas
and trimming whitespace to produce an array, then reference that parsed array
for bots so the bots entry correctly contains multiple entries instead of one
comma string.

In @.github/workflows/gh-aw-project-summary.md:
- Around line 29-44: The workflow uses a CSV string input allowed-bot-users
(inputs.allowed-bot-users) directly as the bots list, which will not correctly
handle comma-separated values; change the workflow to parse the CSV into an
array (split on commas, trim whitespace, filter out empty entries) before
assigning to the bots list (or use a step that converts the CSV to a JSON array
and references that output), ensuring inputs.allowed-bot-users, the bots section
and any consumer steps use the parsed array so multiple bot usernames are
handled correctly.

---

Nitpick comments:
In @.github/workflows/gh-aw-downstream-health.md:
- Around line 98-101: Replace the hardcoded "github-actions[bot]" in the two
search queries with the configurable bot input (e.g., the variable or input
representing allowed bot users such as allowed-bot-users or
inputs.allowed_bot_users) so the prompt builds queries dynamically; update the
lines that construct the github-search_issues and github-search_pull_requests
queries to interpolate that variable (or reference the input explicitly) instead
of the literal "github-actions[bot]" so callers who customize allowed-bot-users
are respected.

Comment on lines +40 to +41
# bots: # Bots processed as bot check in pre-activation job
# - github-actions[bot] # Bots processed as bot check in pre-activation job
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Misleading comments reference non-existent job, and bot configuration is unexpectedly commented out.

The comments claim bots are processed in a pre-activation job, but this workflow has no pre_activation job defined (only activation, agent, conclusion, detection, and safe_outputs).

Additionally, according to the PR description, the upgrade-check workflow is a standalone workflow that should have a hardcoded bots: entry rather than a configurable input. However, both the bots: field and the github-actions[bot] entry are commented out here.

Expected configuration for standalone workflow

Based on the PR objectives, this should likely be:

-  # bots: # Bots processed as bot check in pre-activation job
-  # - github-actions[bot] # Bots processed as bot check in pre-activation job
+  bots:
+  - github-actions[bot]

Or if bot checking isn't needed for this scheduled workflow, these comment lines should be removed to avoid confusion.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# bots: # Bots processed as bot check in pre-activation job
# - github-actions[bot] # Bots processed as bot check in pre-activation job
bots:
- github-actions[bot]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-upgrade-check.lock.yml around lines 40 - 41, The
commented notes about a "pre_activation" job and the commented-out bots
configuration are misleading because this workflow only defines the jobs
activation, agent, conclusion, detection, and safe_outputs; either remove those
comment lines entirely to avoid confusion or add a hardcoded bots: entry for the
standalone upgrade-check workflow (e.g., include bots: [ "github-actions[bot]"
]) in the workflow inputs/top-level config as described in the PR; update the
comment or code near the existing commented lines so they accurately reflect the
actual jobs (activation, agent, conclusion, detection, safe_outputs) and the
chosen approach (remove comments if bot checking is not used, or enable the bots
entry if required).

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.

Allow customizing allowed bot users via a workflow input

1 participant