Skip to content

fix(ci): replace ISF gh pr create with a job-summary PR link - #2294

Merged
Roland Krummenacher (RolandKrummenacher) merged 2 commits into
devfrom
RolandKrummenacher/isf-workflow-pr-link
Sep 1, 2026
Merged

fix(ci): replace ISF gh pr create with a job-summary PR link#2294
Roland Krummenacher (RolandKrummenacher) merged 2 commits into
devfrom
RolandKrummenacher/isf-workflow-pr-link

Conversation

@RolandKrummenacher

Copy link
Copy Markdown
Collaborator

Summary

The Update Instance Size Flexibility workflow has failed on every scheduled run since 17 August (run 32000829915, 32696676461, 33364273736). The failing step is Create PR if data changed:

pull request create failed: GraphQL: GitHub Actions is not permitted to
create or approve pull requests (createPullRequest)

The org has Allow GitHub Actions to create and approve pull requests disabled, and the org policy overrides the workflow's own pull-requests: write.

The break was latent, not new. The step was added on 12 Aug in fa19ad6. The 3 and 10 August runs went green only because they detected no data changes and exited at No changes detected before reaching gh pr create — verified in the 10 Aug log. 17 August was the first run with something to publish, and it has failed the same way every week since.

The fetch and the branch push both succeed — only the PR call fails. So each failed run left an orphan branch behind, and all three carry the identical one-row update:

"NVadsA10_v5 DedicatedHost","nvadsa10v5_type1","72"

Fix

opendata-commitment-eligibility.yml already hit this exact wall and solved it, with a comment saying so. This aligns the ISF workflow with that pattern rather than inventing a second approach: push the branch, then write a one-click compare/dev...$BRANCH?expand=1 link into the job summary for a maintainer to open. Opening the PR from there still triggers Open Data CI and normal review.

The suggested title and body are emitted into the job summary as fenced blocks, so the wording the old PR_BODY carried isn't lost — it's copy-pasteable when opening the PR.

Also in scope:

  • Drops the now-unused pull-requests: write permission and the GITHUB_TOKEN env var. contents: write (push) and id-token: write (OIDC) stay.
  • Appends run_number to the branch name, so a same-day re-run can't collide with the branch an earlier run already pushed. Matches the sibling workflow.

Not in scope

The pending data row is being opened as a separate PR from the newest orphan branch, and the two redundant orphan branches removed. This PR is workflow-only.

No changelog entry — CI-only change with no effect on any shipped artifact, consistent with the other workflow-only PRs (#2242, #2233, #2244).

Test plan

  • yaml.safe_load parses the workflow; permissions resolves to {contents: write, id-token: write} and the step list is unchanged apart from the renamed final step
  • bash -n on the extracted run: script with the ${{ }} expressions stubbed
  • Rendered the job-summary block with a stub BRANCH/PR_URL and confirmed the markdown, the compare link, and both fenced blocks come out correctly
  • Invoke-Pester ./src/powershell/Tests/Unit/Update-InstanceSizeFlexibility.Tests.ps1 — 15/15 pass (no assertions on the workflow file, run as a regression check)
  • workflow_dispatch on this branch after merge to confirm a real run reaches the summary link

🤖 Generated with Claude Code

The org disallows GitHub Actions from opening pull requests, so `gh pr
create` fails with "GitHub Actions is not permitted to create or approve
pull requests (createPullRequest)". The weekly run has failed on 17, 24
and 31 August -- every run since the first one that actually had a data
change to publish. The 3 and 10 August runs passed only because they
detected no changes and exited before the PR step, so the break was
introduced with the step itself and stayed latent for two weeks.

The fetch and the branch push both work; only the PR call fails. Each
failed run therefore left an orphan branch behind, all three carrying the
same one-row update.

Mirrors the pattern already used by opendata-commitment-eligibility.yml,
which hit the same wall: push the branch, then write a one-click compare
link into the job summary for a maintainer to open. Opening the PR from
there still triggers Open Data CI and normal review.

Also drops the now-unused `pull-requests: write` permission and the
GITHUB_TOKEN env var, and appends run_number to the branch name so a
same-day re-run cannot collide with the branch an earlier run pushed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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 fixes the Update Instance Size Flexibility GitHub Actions workflow so it no longer attempts to open a PR via gh pr create (which is blocked by org policy). Instead, when data changes are detected, it pushes a branch and writes a one-click compare/dev...<branch> link plus suggested PR title/body into the job summary for a maintainer to open manually.

Changes:

  • Remove pull-requests: write permission and the gh pr create step that fails under org policy.
  • Push a data-update branch and emit a “Create pull request” compare link + suggested PR text into $GITHUB_STEP_SUMMARY.
  • Append a run identifier to the branch name to reduce collisions with existing pushed branches.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/opendata-instance-size-flexibility.yml Outdated
@flanakin Michael Flanakin (flanakin) added the Status: ▶️ Ready Issue is ready for a dev to start work label Sep 1, 2026
run_number stays the same when a workflow run is re-run, so a re-run of a
run that already pushed its branch would hit a rejected push. Append
run_attempt, which increments per attempt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@RolandKrummenacher
Roland Krummenacher (RolandKrummenacher) merged commit f8d2b02 into dev Sep 1, 2026
4 checks passed
@RolandKrummenacher
Roland Krummenacher (RolandKrummenacher) deleted the RolandKrummenacher/isf-workflow-pr-link branch September 1, 2026 07:00
@microsoft-github-policy-service

Copy link
Copy Markdown

@allcontributors

Copy link
Copy Markdown
Contributor

@microsoft-github-policy-service[bot]

Roland Krummenacher (@RolandKrummenacher) already contributed before to code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed Skill: DevOps GitHub setup and automation Status: ▶️ Ready Issue is ready for a dev to start work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants