Skip to content

fix: replace PR creation with issue creation in refresh-snapshot workflow - #2169

Merged
JasonYeMSFT (JasonYeMSFT) merged 3 commits into
mainfrom
copilot/update-refresh-snapshot-yml
May 5, 2026
Merged

fix: replace PR creation with issue creation in refresh-snapshot workflow#2169
JasonYeMSFT (JasonYeMSFT) merged 3 commits into
mainfrom
copilot/update-refresh-snapshot-yml

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

The refresh-azure-mcp-tool-snapshot.yml workflow was failing silently because GITHUB_TOKEN in this repo lacks pull-requests: write, causing the PR creation step to error out.

Changes

  • Permissions: Swapped contents: write + pull-requests: write for issues: write
  • Removed: Branch checkout, commit, and force-push steps — no longer needed
  • Replaced: "Create or update pull request" step with two new steps:
    • Create issue — uses the GitHub Search API (not listForRepo) to detect duplicates reliably regardless of open-issue volume, then creates an issue with reproduction instructions
    • Assign to @copilot — runs gh issue edit --add-assignee "@copilot" via ASSIGN_ISSUE_TOKEN, matching the pattern in skill-factory.yml
- name: Create issue for snapshot update
  id: create_issue
  if: steps.check_changes.outputs.changed == 'true'
  uses: actions/github-script@...
  with:
    script: |
      const existing = await github.rest.search.issuesAndPullRequests({
        q: `repo:${owner}/${repo} is:issue is:open "${title}" in:title`,
        per_page: 1,
      });
      if (existing.data.total_count > 0) { return; }
      // create issue...

- name: Assign issue to Copilot
  if: steps.create_issue.outputs.issue-number != ''
  env:
    GH_TOKEN: ${{ secrets.ASSIGN_ISSUE_TOKEN }}
  run: gh issue edit ${{ steps.create_issue.outputs.issue-number }} --add-assignee "@copilot"

Copilot AI changed the title [WIP] Update refresh-snapshot.yml to create an issue instead of PR fix: replace PR creation with issue creation in refresh-snapshot workflow May 5, 2026
Copilot AI requested a review from kvenkatrajan May 5, 2026 17:02
@kvenkatrajan
kvenkatrajan marked this pull request as ready for review May 5, 2026 21:11
Copilot AI review requested due to automatic review settings May 5, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the scheduled refresh-azure-mcp-tool-snapshot.yml workflow to stop trying to create/update a pull request (which fails due to missing pull-requests: write on GITHUB_TOKEN) and instead create a deduplicated issue with manual reproduction steps, then assign it to @copilot.

Changes:

  • Replaced PR-creation logic with GitHub Search-based open-issue dedupe + new issue creation via actions/github-script.
  • Removed branch/commit/force-push steps and added a lightweight “check for changes” gate.
  • Added an assignment step using gh issue edit authenticated via ASSIGN_ISSUE_TOKEN.
Show a summary per file
File Description
.github/workflows/refresh-azure-mcp-tool-snapshot.yml Switches snapshot-refresh automation from PR creation to issue creation + assignment when snapshot content changes.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread .github/workflows/refresh-azure-mcp-tool-snapshot.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) merged commit 5f1487e into main May 5, 2026
9 checks passed
@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) deleted the copilot/update-refresh-snapshot-yml branch May 5, 2026 21:34
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.

refresh-snapshot.yml failing with unhandled error due to lack of permissions to create create PR

4 participants