Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/stlc-promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Promote stage — install this file at .github/workflows/stlc-promote.yml in
# EACH SDK repo (linq-go, linq-node, linq-python). It is repo-agnostic.
#
# linq-sdks' "Build SDKs" workflow force-pushes regenerated code to the
# `stainless/release` branch here. This workflow turns that branch into a
# release PR against main. The force-push updates an already-open PR in place,
# so this only needs to create the PR the first time.
#
# Auth: the org-level STLC_ACTIONS_PAT secret (same PAT linq-sdks uses). A PAT,
# not GITHUB_TOKEN, so the release PR triggers this repo's CI checks.

name: Open release PR

on:
push:
branches: [stainless/release]

jobs:
promote:
runs-on: ubuntu-latest
steps:
- name: Open or update the release PR
env:
GH_TOKEN: ${{ secrets.STLC_ACTIONS_PAT }}
REPO: ${{ github.repository }}
run: |
EXISTING=$(gh pr list --repo "$REPO" \
--head stainless/release --base main --state open \
--json number --jq '.[0].number // empty')
if [ -n "$EXISTING" ]; then
echo "Release PR #${EXISTING} already open — the force-push updated it."
exit 0
fi
gh pr create --repo "$REPO" \
--base main --head stainless/release \
--title "Release: regenerated SDK" \
--body "Regenerated by stlc from an updated API spec. Review the diff and merge to cut a release (release-please versions and publishes on merge)."
Loading