Skip to content

Run CI once per pull request - #35

Merged
jbeckwith-oai merged 9 commits into
mainfrom
codex/disambiguate-required-checks
Jul 24, 2026
Merged

Run CI once per pull request#35
jbeckwith-oai merged 9 commits into
mainfrom
codex/disambiguate-required-checks

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

  • run CI for feature and fork contributions through the pull_request event
  • limit push CI to main, eliminating duplicate push and pull-request runs for the same PR commit
  • keep the required check names stable as lint, build, and test

Why

Same-repository PR branches previously triggered both push and pull_request workflow runs. The pull-request jobs were skipped, but still appeared as duplicate checks and could ambiguously satisfy required-check contexts.

After this change, a PR commit produces one CI run. The merged commit gets a separate post-merge run on main. Branches without an open PR no longer run this workflow until a PR is opened.

Validation

  • Actionlint v1.7.12
  • YAML parsing
  • ./scripts/lint
  • ./scripts/test

Copilot AI review requested due to automatic review settings July 24, 2026 17:00
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner July 24, 2026 17:00

@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: 54229c2149

ℹ️ 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 thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml

Copilot AI 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.

Pull request overview

Updates the CI workflow triggers so CI runs once per pull request (via pull_request) and only runs on push for main, avoiding duplicate check suites for same-repo PR branches.

Changes:

  • Restricts push workflow runs to main only.
  • Runs CI for PRs via pull_request and simplifies job-level if: gating.
  • Removes the test job’s previous fork/push-only condition so it runs for PRs as well.
Comments suppressed due to low confidence (2)

.github/workflows/ci.yml:53

  • With CI now running on pull_request for same-repo PRs, github.ref_name resolves to a PR ref (e.g. <pr_number>/merge) rather than the branch name. If the staging-link behavior is intended for PR runs, use github.head_ref (fallback to ref_name for push).
    runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
    if: github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata'
    steps:

.github/workflows/ci.yml:107

  • On pull_request runs, github.ref_name is a PR ref like <pr_number>/merge, not the source branch name. Since this workflow now runs CI on same-repo PRs, the staging-link will no longer work as intended unless it uses github.head_ref for PRs (fallback to ref_name for pushes).
  test:
    timeout-minutes: 10
    name: test
    runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
    steps:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml

@HAYDEN-OAI HAYDEN-OAI 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.

Found two event-context regressions from moving same-repository PR CI from push to pull_request. The workflow needs a PR-head-aware branch identity before this is safe.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 17:11

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml Outdated

@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: 431cd629d6

ℹ️ 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 thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 17:17

@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: 5e1f740d94

ℹ️ 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 thread .github/workflows/ci.yml Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 17:22

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 17:28

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:56

  • The build job grants id-token: write while the job itself runs for pull_request events (including forks). Even though the OIDC/upload steps are gated on IS_TRUSTED_SOURCE, any earlier step that executes PR-controlled code (including ./scripts/* or local actions) could potentially request an OIDC token if the platform allows it, which is a least-privilege/security concern.

Consider moving the OIDC token + tarball upload into a separate job that only runs when IS_TRUSTED_SOURCE == 'true' (and give that job id-token: write), while keeping the main build job at contents: read for all PRs.

    permissions:
      contents: read
      id-token: write
    runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
    if: github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata'

Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 19:51

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@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: 7a098727bb

ℹ️ 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 thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 19:58

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:175

  • The workflow still skips lint/build-artifacts (and thus build) on push commits with message codegen metadata, but test will still run on those pushes since its job-level if: was removed. If the intent is to suppress CI for these codegen-metadata pushes, test should use the same predicate to avoid running a partial CI set and consuming runner time.
  test:
    timeout-minutes: 10
    name: test
    runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
    steps:

Copilot AI review requested due to automatic review settings July 24, 2026 20:04

@HAYDEN-OAI HAYDEN-OAI 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.

Reviewed current head b639ce8 end-to-end, including prior threads, pull-request versus push SHA/ref semantics, fork gating, OIDC isolation, the tar-wrapped artifact handoff, required build aggregation, and the final metadata-push alignment. I found no substantive issues.

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 24, 2026 20:10

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.github/actions/setup-go/action.yml:22

  • This composite action runs ./scripts/bootstrap (later in the file) while the CI workflow also runs ./scripts/bootstrap after optional ./scripts/link adjustments. Since this action is only used by .github/workflows/ci.yml right now, keeping bootstrap in both places causes redundant (and potentially expensive) bootstrap runs on every job. Consider removing the bootstrap step from this action and letting the workflow own when bootstrap happens (especially since it needs to occur after any ./scripts/link replacement).
      if: steps.get_token.outputs.github_access_token != ''
      shell: bash
      env:
        GITHUB_ACCESS_TOKEN: ${{ steps.get_token.outputs.github_access_token }}
      run: |

@HAYDEN-OAI HAYDEN-OAI 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.

Re-reviewed current head 5a8fe77, including the full PR and the delta since the prior approval. The setup-go follow-up cleanly skips private token retrieval and Git rewriting when fork PRs receive no secret, while preserving the trusted publish boundary and required build aggregation. I found no substantive issues.

@jbeckwith-oai
jbeckwith-oai merged commit 4a207c9 into main Jul 24, 2026
10 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/disambiguate-required-checks branch July 24, 2026 20:22
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.

3 participants