Skip to content

ci: add release-please-develop pre-release workflow - #734

Open
SoulPancake wants to merge 1 commit into
mainfrom
feat/release-please-develop
Open

ci: add release-please-develop pre-release workflow#734
SoulPancake wants to merge 1 commit into
mainfrom
feat/release-please-develop

Conversation

@SoulPancake

@SoulPancake SoulPancake commented Jul 28, 2026

Copy link
Copy Markdown
Member

Adds a release-please-develop workflow enabling pre-release (alpha/beta/rc) releases from the develop branch, via workflow_dispatch or on merge of a release: PR. It is a thin caller around the shared openfga/.github reusable release-please-prerelease.yml, mirroring the existing release-please main flow.

Reference: https://github.com/openfga/js-sdk/blob/main/.github/workflows/release-please-develop.yml

Summary by CodeRabbit

  • Chores
    • Added automated prerelease workflow support for changes pushed to the development branch.
    • Added the option to manually trigger prerelease automation with a specified release version.
    • Improved release automation permissions and signing support.

Copilot AI review requested due to automatic review settings July 28, 2026 11:38
@SoulPancake
SoulPancake requested a review from a team as a code owner July 28, 2026 11:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow to support a pre-release lane from the develop branch, delegating the actual release logic to the shared openfga/.github reusable workflow (pinned by SHA) to keep implementation consistent across SDK repos.

Changes:

  • Introduces .github/workflows/release-please-develop.yml to generate/publish pre-releases from develop.
  • Supports both workflow_dispatch (explicit pre-release version input) and push to develop gated on release:-prefixed merge commits.
  • Configures job-level permissions and passes expected inputs (base-branch, staging-branch, trigger-event) to the reusable workflow.

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

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds a GitHub Actions workflow that runs prerelease automation for develop, supports manual version input, gates execution to approved events, and passes release, branch, permission, and signing configuration to a pinned reusable workflow.

Changes

Develop prerelease automation

Layer / File(s) Summary
Configure develop prerelease release flow
.github/workflows/release-please-develop.yml
Adds push and manual triggers, read/write permissions, execution gating, pinned reusable workflow wiring, prerelease version and branch settings, and release/signing secrets.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • openfga/cli#717: Uses pinned openfga/.github reusable release workflows in GitHub Actions configuration.

Suggested reviewers: curfew-marathon, copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a develop-focused release-please pre-release workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/release-please-develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release-please-develop.yml:
- Around line 26-31: Update the reusable workflow’s release-version handling so
the workflow input is passed through an environment variable and validated
before use, rather than interpolated into the parse-release.sh invocation or
commit commands. Preserve the required alpha/beta/rc format validation, use the
validated value safely in shell steps, and update the referenced commit pin to
include this fix.
- Around line 14-16: Update the trigger comments near the reusable prerelease
workflow to clarify that it creates the signed tag and draft release, while
publication is performed downstream by a separate workflow; do not describe this
workflow as publishing the release.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b34fa4bb-4de8-4dc4-bc35-67d9a321bdac

📥 Commits

Reviewing files that changed from the base of the PR and between 5546e9b and cd8eae0.

📒 Files selected for processing (1)
  • .github/workflows/release-please-develop.yml

Comment on lines +14 to +16
# Triggers:
# * workflow_dispatch → build a release PR for an explicit pre-release version
# * push to develop → when the `release:` PR merges, tag + draft + publish

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate workflow files =="
git ls-files .github/workflows | sed -n '1,120p'

echo
echo "== target workflow =="
cat -n .github/workflows/release-please-develop.yml

echo
echo "== related release workflow lines =="
for f in .github/workflows/release-please-prerelease.yml .github/workflows/*.yml; do
  if [ -f "$f" ]; then
    echo "--- $f (release/publish references) ---"
    rg -n "release-please-prerelease|publish|draft|tag|workflow_run|workflow_dispatch|develop|release:" "$f" || true
  fi
done

echo
echo "== git diff stat/name =="
git diff --stat HEAD~1...HEAD 2>/_dev/null || git diff --stat 2>/dev/null || true
git diff -- .github/workflows/release-please-develop.yml 2>/dev/null || true

Repository: openfga/cli

Length of output: 4414


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== parse reusable workflow trigger/calls =="
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/release-please-prerelease.yml")
print(f"exists={p.exists()}")
if p.exists():
    text = p.read_text()
    for i,line in enumerate(text.splitlines(),1):
        if "on:" in line or "release-please" in line or "workflow_dispatch" in line or "workflow_run" in line or "push to" in line:
            print(f"{i}: {line}")
PY

echo
echo "== parse develop workflow call =="
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/release-please-develop.yml")
print(f"exists={p.exists()}")
if p.exists():
    for i,line in enumerate(p.read_text().splitlines(),1):
        if "uses:" in line or "on:" in line or "push" in line or "workflow_dispatch" in line or "release:" in line:
            print(f"{i}: {line}")
PY

Repository: openfga/cli

Length of output: 852


🌐 Web query:

openfga .github release-please-prerelease.yml workflow publish draft tag

💡 Result:

The release-please-prerelease.yml workflow within the openfga/.github repository is a reusable workflow designed to handle pre-release (alpha/beta/rc) versions for OpenFGA SDKs and components [1]. Key insights regarding the use of draft releases and tag creation with release-please are as follows: 1. Draft Releases and Tagging: By default, GitHub does not create a Git tag for draft releases [2][3]. This can cause issues for release-please because it relies on previous tags to calculate version bumps and generate changelogs [2][3]. 2. Handling Tag Creation: To address the lack of a tag when using draft: true, release-please provides a configuration option called --force-tag-creation (or equivalent in the action configuration) [3]. Enabling this ensures that a Git tag is created immediately, even if the release is marked as a draft [3]. 3. Common Workaround: If you are not using --force-tag-creation, a common manual workaround to avoid errors in subsequent release-please runs is to temporarily set draft: false to force the tag creation, and then immediately convert the release back to a draft using the GitHub CLI [2]: - name: Convert to Draft if: ${{ steps.release.outputs.release_created }} run: gh release edit "$TAG" --draft=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ steps.release.outputs.tag_name }} 4. OpenFGA Implementation: The release-please-prerelease.yml in openfga/.github was specifically created to provide a dedicated "pre-release lane" that mirrors the main release-please machinery without impacting stable releases on the main branch [1][4]. It allows for parameterized base branches to facilitate versioning from long-lived development branches [1]. When integrating this, it is recommended to reference the reusable workflow using an immutable commit SHA rather than a mutable tag like @main to prevent unexpected behavior due to workflow updates [4].

Citations:


Clarify that publishing is downstream.

This workflow only calls the reusable prerelease workflow, which creates the signed tag and draft release; publication is handled by a separate workflow.

Suggested wording
-#   * push to develop   → when the `release:` PR merges, tag + draft + publish
+#   * push to develop   → when the `release:` PR merges, tag + draft
+#                         (publishing is handled by the downstream workflow)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Triggers:
# * workflow_dispatch → build a release PR for an explicit pre-release version
# * push to develop → when the `release:` PR merges, tag + draft + publish
# Triggers:
# * workflow_dispatch → build a release PR for an explicit pre-release version
# * push to develop → when the `release:` PR merges, tag + draft
# (publishing is handled by the downstream workflow)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-please-develop.yml around lines 14 - 16, Update
the trigger comments near the reusable prerelease workflow to clarify that it
creates the signed tag and draft release, while publication is performed
downstream by a separate workflow; do not describe this workflow as publishing
the release.

Comment on lines +26 to +31
release-version:
description: >
Explicit pre-release version to cut (e.g. 0.10.0-beta.1, 0.10.0-rc.2).
Must include an alpha/beta/rc suffix. Stable versions are rejected.
required: true
type: string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow file =="
cat -n .github/workflows/release-please-develop.yml

echo
echo "== find referenced reusable workflow =="
rg -n "release-please-prerelease|actions/checkout|uses:.*\\.github/workflows" .github/workflows/release-please-develop.yml .github/workflows || true

Repository: openfga/cli

Length of output: 4808


🌐 Web query:

raw.githubusercontent.com openfga .github 835baf31562809ad9eb884c73efc5b79318f700f .github/workflows/release-please-prerelease.yml

💡 Result:

The file.github/workflows/release-please-prerelease.yml in the openfga/.github repository (referenced at commit 835baf3) is a shared, reusable GitHub Actions workflow designed to automate the creation of pre-release versions (such as alpha, beta, or release candidates) [1]. Key characteristics of this workflow include: Purpose: It provides a dedicated "pre-release lane" for cutting non-stable versions from long-lived development branches (e.g., develop) without interfering with the stable release processes managed by the standard release-please.yml workflow on the main branch [1][2]. Mechanism: It mirrors the functionality of the standard release-please workflow but is specifically configured for pre-releases [1]. It is designed to be parameterized by base and staging branches, allowing various OpenFGA SDKs and repositories to onboard it easily as a thin caller [1]. Implementation: The workflow supports conventional commits and automates tasks such as creating draft pre-releases and GPG-signed tags [2][3]. It enables development teams to test release candidates without disrupting stable release lanes [2]. This reusable workflow was introduced to allow for a promotion model where pre-releases are generated from development branches, while stable releases continue to be managed strictly through the main branch [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== fetch pinned reusable workflow =="
curl -fsSL 'https://raw.githubusercontent.com/openfga/.github/835baf31562809ad9eb884c73efc5b79318f700f/.github/workflows/release-please-prerelease.yml' | cat -n

echo
echo "== direct shell invariance probe for quoted version interpolation =="
python3 - <<'PY'
version = '" echo "PWNED" # not a version'
run = f'echo "Version: {version}"'
print(run)
PY

Repository: openfga/cli

Length of output: 16195


Do not interpolate release-version into shell source.

At .github/workflows/release-please-develop.yml:41-44, a workflow_dispatch payload reaches the reusable workflow, which currently expands it directly into run: scripts (bash .shared-ci/.github/workflows/scripts/parse-release.sh ... / commit commands) before validation. A crafted value can break out of the shell command and execute in a job with write permissions and release secrets. Change the reusable workflow to receive it through env, validate it there, then update this commit pin accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-please-develop.yml around lines 26 - 31, Update
the reusable workflow’s release-version handling so the workflow input is passed
through an environment variable and validated before use, rather than
interpolated into the parse-release.sh invocation or commit commands. Preserve
the required alpha/beta/rc format validation, use the validated value safely in
shell steps, and update the referenced commit pin to include this fix.

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