Skip to content

[codex] add safe automerge workflow#2

Open
nnlevy wants to merge 1 commit intomasterfrom
codex/safe-automerge-workflow
Open

[codex] add safe automerge workflow#2
nnlevy wants to merge 1 commit intomasterfrom
codex/safe-automerge-workflow

Conversation

@nnlevy
Copy link
Owner

@nnlevy nnlevy commented Feb 17, 2026

Codex Workflow Rollout

This PR adds the safe Codex auto-merge workflow for this repository.

Verification

  • Added workflow file: ..github/workflows/codex-automerge.yml
  • Added documentation file: docs/codex-workflow.md
  • Denylist enforced in workflow before any merge attempt:
    • **/*wrangler*.{json,toml}
    • **/.github/workflows/**
    • **/src/**/stripe*
    • **/src/**/payments*
    • **/src/**/auth*
    • **/src/**/sessions*
    • **/src/**/worker/**/env*
    • **/routing/**
    • **/redirect
    • **/canonical
    • **/migrations/**
    • **/*.sql

PR behavior notes

  • Label strategy and semantics documented in docs/codex-workflow.md.
  • Workflow triggers only for label automerge, non-draft PRs, and chatgpt-codex-connector author or codex/ head branch.
  • No runtime code files are changed in this rollout PR.

Label guidance (manual)

Do NOT label this PR as automerge; rollout PRs are for infrastructure updates only.

Copy link

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

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: c0f2a5bf9a

ℹ️ 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".


function globToRegex(glob) {
let out = String(glob)
.replace(/[.+^${}()|[\]\]/g, '\\$&')

Choose a reason for hiding this comment

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

P1 Badge Fix invalid regex literal in glob escaping

The globToRegex helper currently contains an invalid JavaScript regex (/[.+^${}()|[\]\]/g), which causes a SyntaxError when actions/github-script evaluates the step, so this workflow job fails before it can evaluate file changes or enable auto-merge for any PR.

Useful? React with 👍 / 👎.

Comment on lines +48 to +49
.replace(/\*\*/g, '.*')
.replace(/\*/g, '[^/]*')

Choose a reason for hiding this comment

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

P1 Badge Preserve double-star glob behavior in denylist matching

The replacement order in globToRegex converts ** to .* and then immediately rewrites that * into [^/]*, so patterns like **/.github/workflows/** and **/*.sql no longer match repo-root paths (for example .github/workflows/x.yml or schema.sql), allowing denylisted files to bypass the safety gate and be auto-merged when labeled.

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