Skip to content

Add issues:write permission to activation/conclusion jobs when lock-for-agent is enabled - #6268

Merged
pelikhan merged 2 commits into
mainfrom
copilot/update-activation-conclusion-jobs
Dec 12, 2025
Merged

pelikhan merged 2 commits into
mainfrom
copilot/update-activation-conclusion-jobs

Conversation

Copilot AI commented Dec 12, 2025 •

Copy link
Copy Markdown
Contributor

The activation and conclusion jobs failed when lock-for-agent was enabled without ai-reaction configured, because the GitHub API's issues.lock() and issues.unlock() endpoints require write permissions.

Changes

  • pkg/workflow/compiler_jobs.go: Added conditional issues: write permission to activation job when lock-for-agent: true, independent of reaction configuration
  • pkg/workflow/lock_for_agent_test.go: Added permission assertions to verify correct behavior with and without reactions

Example

Before:

# lock-for-agent: true, no reaction
activation:
  permissions:
    contents: read
    # Missing issues: write → API call fails

After:

# lock-for-agent: true, no reaction  
activation:
  permissions:
    contents: read
    issues: write  # Added for lock API

The conclusion job already had correct permissions via NewPermissionsContentsReadIssuesWritePRWriteDiscussionsWrite().

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login g_.a GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go b-ag�� GmkEpiFk4 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm env tags/v5 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login d-artifact.git GO111MODULE e/git GOINSECURE GOMOD GOMODCACHE e/git env -json om/different-owner/different-repo 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The activation and conclusion jobs should have "issue: write" permission when locking is needed.

Reference: https://github.com/githubnext/gh-aw/actions/runs/20168343382/job/57897233312


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

… enabled

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add write permission for activation and conclusion jobs Add issues:write permission to activation/conclusion jobs when lock-for-agent is enabled Dec 12, 2025
Copilot AI requested a review from pelikhan December 12, 2025 14:06
@pelikhan
pelikhan marked this pull request as ready for review December 12, 2025 14:25
@pelikhan
pelikhan merged commit 39d0a7f into main Dec 12, 2025
4 checks passed
@pelikhan
pelikhan deleted the copilot/update-activation-conclusion-jobs branch December 12, 2025 14:26
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