Files
codex-security/.github/workflows/node-release-pr.yml
Michael D'Angeloandmldangelo-oai 140c88bd42 ci(release): reduce progress noise and preserve manual updates (#1928)
* ci(release): reduce progress runs and redundant proposal updates

* fix(ci): preserve pending release refreshes during push bursts

* fix(ci): identify the release head in note suggestions

* ci(release): keep prompt proposals and route progress through main CI

* fix(ci): serialize release previews with proposal updates

---------

Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com>
2026-10-25 14:31:41 +08:00

92 lines
2.9 KiB
YAML

name: node-release-pr
on:
push:
branches: [main]
workflow_dispatch:
inputs:
dry_run:
description: Preview the release PR without changing GitHub
type: boolean
default: true
permissions:
contents: read
pull-requests: read
concurrency:
# A newer push can replace a pending push without displacing a manual run.
group: node-release-pr-${{ github.event_name == 'push' && 'push' || github.run_id }}
cancel-in-progress: false
jobs:
preview:
if: >-
github.repository == 'openai/codex-security' && github.ref == 'refs/heads/main' &&
((github.event_name == 'workflow_dispatch' && inputs.dry_run) ||
(github.event_name != 'workflow_dispatch' && vars.RELEASE_PR_ENABLED != 'true'))
name: preview release PR
runs-on: ubuntu-latest
# Keep the writer from changing the release branch while a preview reads it.
concurrency: &release-pr-queue
group: node-release-pr
queue: max
env:
RELEASE_PR_DRY_RUN: "true"
steps:
- &checkout-main-never-the-release-pr
name: Checkout main, never the release PR
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
fetch-depth: 0
persist-credentials: false
- &set-up-node-js
name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22.13.0"
- name: Preview the rolling release proposal
env:
GH_TOKEN: ${{ github.token }}
run: node sdk/typescript/scripts/release-pr.mjs
reconcile:
if: >-
github.repository == 'openai/codex-security' && github.ref == 'refs/heads/main' &&
((github.event_name == 'workflow_dispatch' && !inputs.dry_run) ||
(github.event_name != 'workflow_dispatch' && vars.RELEASE_PR_ENABLED == 'true'))
name: maintain release PR
runs-on: ubuntu-latest
concurrency: *release-pr-queue
permissions:
contents: write
pull-requests: write
env:
RELEASE_PR_DRY_RUN: "false"
steps:
- *checkout-main-never-the-release-pr
- *set-up-node-js
- name: Create repository-scoped release App token
id: app-token
if: vars.RELEASE_APP_CLIENT_ID != ''
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.RELEASE_APP_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-contents: write
permission-pull-requests: write
- name: Reconcile the rolling release proposal
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: node sdk/typescript/scripts/release-pr.mjs