Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Finish release when PR is approved
if: >
github.event.review.state == 'approved' &&
github.event.pull_request.base.ref == 'develop' &&
github.event.pull_request.base.ref == 'main' &&
startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
env:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/component-release-workflow-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This prevents two runs for the same version/type from racing on branches/tags.
**Main release - approvable**
1. Validates version format.
2. Runs `git flow release start` -> changelog -> `release publish`.
3. Creates a PR: `release/<version>` -> `develop`.
3. Creates a PR: `release/<version>` -> `main`.
4. Stops and waits for PR approval.
5. On approval, the second workflow finishes the release.

Expand All @@ -48,14 +48,15 @@ This prevents two runs for the same version/type from racing on branches/tags.

### 2. Component Release Finish On Approval (`component-release-finish-on-approval.yml`)

Triggered on approved review for `release/*` PRs targeting `develop`.
Triggered on approved review for `release/*` PRs targeting `main`.

#### What it does
1. Verifies PR review decision is `APPROVED`.
2. Checks out release branch.
3. Runs `git flow release finish` (merge to `main` + `develop`, create tag).
4. Pushes `main`, `develop`, and tags.
5. Closes the release PR.
5. Deletes remote `release/<version>` branch.
6. Closes the release PR.

## Authentication and Secrets

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/component-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
git push origin main
git push origin --tags
git push origin develop
git push origin --delete "release/${RELEASE_VERSION}" || true
git push origin --delete "release/${RELEASE_VERSION}" || true

#
# ── APPROVABLE RELEASE ──
Expand Down Expand Up @@ -148,16 +148,16 @@ jobs:
git flow release publish "${RELEASE_VERSION}"
fi

existing_pr=$(gh pr list --head "${release_branch}" --base develop --state open --json number -q '.[0].number')
existing_pr=$(gh pr list --head "${release_branch}" --base main --state open --json number -q '.[0].number')
Comment thread
yogeswaransky marked this conversation as resolved.
if [ -z "${existing_pr}" ]; then
gh pr create \
--base develop \
--base main \
--head "${release_branch}" \
--title "Release ${RELEASE_VERSION}" \
--body "Automated release PR for ${RELEASE_VERSION}. Approve this PR to trigger release finish."
echo "PR created. Waiting for approval to finish release."
else
echo "PR from ${release_branch} to develop already exists (#${existing_pr})."
echo "PR from ${release_branch} to main already exists (#${existing_pr})."
fi

#
Expand Down