Add on.skip-author-associations pre-activation gating by author_association#31836
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add on.skip-author-associations pre-activation skip condition
Add May 13, 2026
on.skip-author-associations pre-activation gating by author_association
Copilot created this pull request from a session on behalf of
pelikhan
May 13, 2026 01:31
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new frontmatter trigger guard (on.skip-author-associations) that is compiled into a pre-activation job-level if expression to skip runs early based on (event_name, author_association) combinations.
Changes:
- Introduces
on.skip-author-associationsextraction + normalization intoWorkflowData. - Emits a job-level pre-activation
ifguard compiled from configured event → association lists. - Updates schema/docs and adopts the feature in the
ai-moderatorworkflow; adds unit tests.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/skip_author_associations_test.go | Adds tests for extraction and lockfile compilation output. |
| pkg/workflow/role_checks.go | Extracts/normalizes on.skip-author-associations from frontmatter. |
| pkg/workflow/frontmatter_extraction_yaml.go | Attempts to comment out skip-author-associations in rendered on: YAML. |
| pkg/workflow/compiler_types.go | Adds SkipAuthorAssociations to WorkflowData. |
| pkg/workflow/compiler_pre_activation_job.go | Builds skip-author-associations condition and combines it into the pre-activation job if. |
| pkg/workflow/compiler_orchestrator_workflow.go | Wires extraction into workflow compilation. |
| pkg/workflow/compiler_jobs.go | Ensures pre-activation job is generated when skip-author-associations is configured. |
| pkg/parser/schemas/main_workflow_schema.json | Adds schema for on.skip-author-associations. |
| docs/src/content/docs/reference/frontmatter.md | Documents the new frontmatter field. |
| docs/src/content/docs/guides/maintaining-repos.md | Adds maintainer guidance for association-based early skipping. |
| .github/workflows/ai-moderator.md | Adopts skip-author-associations in the source workflow frontmatter. |
| .github/workflows/ai-moderator.lock.yml | Updates generated lock workflow output (currently invalid YAML per stored comment). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 12/12 changed files
- Comments generated: 7
Comment on lines
+642
to
+646
| associationIsSkipped := BuildFunctionCall( | ||
| "contains", | ||
| BuildFunctionCall("fromJSON", BuildStringLiteral(string(associationJSON))), | ||
| BuildPropertyAccess("github.event.author_association"), | ||
| ) |
Comment on lines
+341
to
+346
| // Check if we're entering skip-author-associations object | ||
| if !inPullRequest && !inIssues && !inDiscussion && !inIssueComment && !inSkipAuthorAssociations { | ||
| if strings.HasPrefix(trimmedLine, "skip-author-associations:") && trimmedLine == "skip-author-associations:" { | ||
| inSkipAuthorAssociations = true | ||
| } | ||
| } |
Comment on lines
+71
to
+82
| issue_comment: | ||
| - owner | ||
| - member | ||
| - collaborator | ||
| issues: | ||
| - owner | ||
| - member | ||
| - collaborator | ||
| pull_request: | ||
| - owner | ||
| - member | ||
| - collaborator |
Comment on lines
+75
to
+86
| assert.Contains(t, preActivationSection, "github.event.author_association") | ||
| assert.Contains(t, preActivationSection, "github.event_name == 'issue_comment'") | ||
| assert.Contains(t, preActivationSection, "github.event_name == 'pull_request_review_comment'") | ||
| assert.Contains(t, preActivationSection, "CONTRIBUTOR") | ||
| assert.Contains(t, preActivationSection, "FIRST_TIME_CONTRIBUTOR") | ||
| assert.Contains(t, preActivationSection, "NONE") | ||
| assert.Contains(t, preActivationSection, "!(") | ||
| assert.Contains(t, preActivationSection, "||") | ||
| assert.Contains(t, preActivationSection, "&&") | ||
|
|
||
| assert.Contains(t, lockContentStr, "# skip-author-associations:") | ||
| assert.NotContains(t, lockContentStr, "skip-author-association:") |
Comment on lines
+356
to
+375
| ### Skip Author Associations (`on.skip-author-associations`) | ||
|
|
||
| Skip workflow execution at the pre-activation job level when a specific event is triggered by an author with a matching `github.event.author_association`. | ||
|
|
||
| ```yaml wrap | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| skip-author-associations: | ||
| issue_comment: contributor | ||
| pull_request_review_comment: [first_time_contributor, none] | ||
| ``` | ||
|
|
||
| **Behavior**: | ||
|
|
||
| - Compiles to a job-level `if` expression (no pre-activation script step cost for matched skips) | ||
| - Uses `github.event.author_association` | ||
| - Values are case-insensitive in frontmatter (`contributor` and `CONTRIBUTOR` are treated the same) |
| issue_comment: [owner, member, collaborator] | ||
| ``` | ||
|
|
||
| This compiles into a pre-activation job-level `if` guard (using `github.event.author_association`), so matching runs are skipped before agent execution starts. |
| }, | ||
| "skip-author-associations": { | ||
| "type": "object", | ||
| "description": "Skip workflow execution when github.event.author_association matches configured associations for specific events. Keys are event names (for example: issue_comment, pull_request_review_comment, issues, pull_request). Values accept a single string or an array of strings. Association values are case-insensitive in frontmatter.", |
Collaborator
|
@copilot merge main and review all comments and recompile |
…or-association-field Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in Merged |
This was referenced May 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New Feature
This adds a frontmatter trigger guard for skipping runs by author association on specific events, compiled into a job-level
ifso matching runs are skipped before pre-activation logic executes.The feature supports both single-string and array forms per event, using
github.event.author_association.What does this feature do?
on.skip-author-associations(event → association list mapping).issue_comment: contributorpull_request_review_comment: [first_time_contributor, none]Why is this feature needed?
Implementation details
on.skip-author-associationswith per-event value typestring | string[].ifterms usinggithub.event_name+github.event.author_association.skip-author-associationsin renderedon:section; updated frontmatter and maintainer docs.ai-moderatorworkflow to use the new field.