Skip to content

fix(ci): flag a refresh with an issue, not a pull request - #14

Merged
afadil merged 1 commit into
mainfrom
fix/refresh-flag-via-issue
Aug 24, 2026
Merged

fix(ci): flag a refresh with an issue, not a pull request#14
afadil merged 1 commit into
mainfrom
fix/refresh-flag-via-issue

Conversation

@afadil

@afadil afadil commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

The weekly refresh job has been failing at its last step:

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

The organization disallows it, and that overrides the repository setting, so
gh pr create cannot work here whatever the workflow asks for in its
permissions block. That org policy is worth keeping: the same switch also
grants Actions the ability to approve pull requests, which is the half that
undermines required reviews.

Everything before that step was fine. The branch pushes, so the only real
failure is that nobody gets told. It also does not self-heal: every Monday it
re-derives, force-pushes over the branch, finds no pull request, and fails
again, with the drift piling up somewhere nobody looks.

Issues are not covered by the policy. So this pushes the branch exactly as
before and opens an issue linking to the compare view, where opening the pull
request is one click. A human was always going to review the diff before
merging, so this costs a click and changes nothing about the review.

The issue says what moved, and reminds whoever reads it that merging is not the
whole job: the website builds from its own committed snapshot and needs a
pnpm sync:addons afterwards.

One issue per outstanding refresh. A second run comments on the open one
instead of filing a duplicate.

What is unchanged

Trigger, derivation, the git diff --quiet guard, the branch name, the
force-push, and the files touched. A week where nothing moved still produces
nothing at all.

Verified

  • YAML parses; the extracted shell passes bash -n
  • The rendered issue body was checked by running the script, backticks and
    compare link intact
  • The duplicate lookup returns empty against the live issue list, and matches
    an exact title in a synthetic test without false-matching a similar one
  • The new protect main ruleset does not interfere: it targets
    ~DEFAULT_BRANCH, while the force-push goes to chore/refresh-derived-facts

The weekly refresh has been failing at the last step:

  GitHub Actions is not permitted to create or approve pull requests

The organization disallows it, which overrides the repository setting,
so `gh pr create` cannot work here no matter what the workflow asks for
in its permissions block. That org policy is worth keeping.

Everything before that step was fine. The branch pushes, so the failure
is only that nobody gets told. Worse, it does not self-heal: every Monday
it force-pushes over the branch, finds no pull request, fails again, and
the drift piles up somewhere nobody looks.

Issues are not covered by the policy. So push the branch as before and
open an issue linking to the compare view, where opening the pull request
is one click. A human was always going to review the diff, and the issue
says what moved and reminds whoever reads it that the website needs its
own sync afterwards.

One issue per outstanding refresh: a second run comments on the open one
instead of filing a duplicate.
@afadil
afadil merged commit dd24f04 into main Aug 24, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b4d99d260

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +117 to +119
existing="$(gh issue list --state open --limit 100 --json number,title \
--jq '.[] | [.number, .title] | @tsv' \
| awk -F'\t' -v t="$title" '$2 == t { print $1; exit }')"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Search all open issues before creating another

When the repository has more than 100 open issues and the refresh issue falls outside the fetched set, this lookup returns nothing and the workflow creates a duplicate despite the one-outstanding-issue invariant. The local gh issue list --help describes --limit as the “Maximum number of issues to fetch,” so the fixed limit does not perform an exhaustive duplicate check; filter by the exact title through --search or otherwise paginate the complete result.

Useful? React with 👍 / 👎.

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.

1 participant