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