Skip to content
Merged
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
40 changes: 38 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
release:
Expand All @@ -14,6 +15,7 @@ jobs:
persist-credentials: true
fetch-tags: true
fetch-depth: 0
token: ${{ secrets.WRITE_GH_TOKEN }}
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

This workflow requires a custom secret (WRITE_GH_TOKEN) for checkout and for GITHUB_TOKEN, but the repo doesn’t reference this secret anywhere else. If this secret isn’t configured in all environments, the release workflow will fail; prefer using the built-in GITHUB_TOKEN with the needed permissions, or add explicit documentation/validation for the required secret.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback


- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
Expand All @@ -23,9 +25,43 @@ jobs:
with:
go-version: "stable"

- name: release
- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Create release branch and run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.WRITE_GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci

# Create a unique release branch
TIMESTAMP=$(date +%s)
BRANCH_NAME="release-${TIMESTAMP}"

# Create and checkout release branch
git checkout -b "${BRANCH_NAME}"

# Run semantic-release on the release branch
npx semantic-release --debug

# Check if semantic-release made changes
if git diff --quiet origin/main HEAD 2>/dev/null || [ $(git rev-list --count HEAD ^origin/main) -eq 0 ]; then
echo "No release created"
exit 0
fi

# Push the release branch
git push origin "${BRANCH_NAME}"

# Get the version from the commit message or package.json
VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "unknown")

# Create pull request
gh pr create \
--title "chore(release): ${VERSION}" \
--body "Automated release PR for version ${VERSION}. This PR includes updates to CHANGELOG.md and package.json. Once this PR is merged to main, the GitHub release will be created automatically." \
--base main \
--head "${BRANCH_NAME}" \
--label "release"
75 changes: 0 additions & 75 deletions issues/1.md

This file was deleted.

Loading
Loading