fix: skip unlock job when activation was skipped#34124
Merged
Merged
Conversation
Update buildUnlockJob to use `always() && needs.activation.result != 'skipped'` as the job-level condition. This ensures the unlock job is skipped when the activation job was skipped (e.g. the event did not match the trigger condition and no issue locking occurred), while still running when activation fails. Recompile ai-moderator.lock.yml and workflow-generator.lock.yml. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
fix: skip unlock job when activation job was skipped
fix: skip unlock job when activation was skipped
May 22, 2026
Copilot created this pull request from a session on behalf of
pelikhan
May 22, 2026 22:17
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents the dedicated unlock job from running (and consuming a runner) when the activation job was skipped due to trigger/condition mismatch—i.e., when no issue could have been locked in the first place.
Changes:
- Update the unlock job’s job-level
if:fromalways()toalways() && needs.activation.result != 'skipped'. - Update lock-for-agent unit tests to assert the new combined unlock job condition.
- Recompile the affected generated workflows to include the updated unlock job condition.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_unlock_job.go |
Adds an activation-not-skipped guard to the unlock job job-level condition while preserving always() behavior for failures. |
pkg/workflow/lock_for_agent_test.go |
Updates assertions to match the new unlock job if: condition in generated YAML. |
.github/workflows/ai-moderator.lock.yml |
Regenerated workflow reflects the updated unlock job condition. |
.github/workflows/workflow-generator.lock.yml |
Regenerated workflow reflects the updated unlock job condition. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
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.
When the activation job is skipped (event doesn't match the trigger), the unlock job was still running and consuming a runner — despite no issue ever being locked.
Changes
pkg/workflow/compiler_unlock_job.go: Change the unlock job'sifcondition fromalways()toalways() && needs.activation.result != 'skipped'pkg/workflow/lock_for_agent_test.go: Update assertions to check for the new combined conditionai-moderator.lock.yml,workflow-generator.lock.yml: RecompiledThe unlock job still runs when activation fails (allowing locked issues to be unlocked on error), but is now correctly skipped when activation was never triggered.