-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Fix CI/CD pipeline trying to double release on commits to main #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
charlesvien
merged 2 commits into
main
from
01-17-fix_ci_cd_pipeline_trying_to_double_release_on_commits_to_main
Jan 17, 2026
+80
−57
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,6 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: Tag Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "apps/array/**" | ||
| - "packages/agent/**" | ||
| - "packages/electron-trpc/**" | ||
| - "pnpm-lock.yaml" | ||
| - "package.json" | ||
| - "turbo.json" | ||
| - ".github/workflows/tag.yml" | ||
| - ".github/workflows/array-release.yml" | ||
|
|
||
| concurrency: | ||
| group: tag | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| tag: | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Get app token | ||
| id: app-token | ||
| uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3 | ||
| with: | ||
| app_id: ${{ secrets.GH_APP_ARRAY_RELEASER_APP_ID }} | ||
| private_key: ${{ secrets.GH_APP_ARRAY_RELEASER_PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
| - name: Compute version and create tag | ||
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| # Find the latest minor version tag (vX.Y format - exactly 2 parts) | ||
| LATEST_TAG=$(git tag --list 'v[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+$' | head -1) | ||
|
|
||
| # Fall back to vX.Y.0 format if no vX.Y tags exist (backward compat) | ||
| if [ -z "$LATEST_TAG" ]; then | ||
| LATEST_TAG=$(git tag --list 'v[0-9]*.[0-9]*.0' --sort=-v:refname | head -1) | ||
| fi | ||
|
|
||
| if [ -z "$LATEST_TAG" ]; then | ||
| echo "No version tag found. Create one with: git tag v0.15 && git push origin v0.15" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Extract major.minor from tag | ||
| VERSION_PART=${LATEST_TAG#v} | ||
| MAJOR=$(echo "$VERSION_PART" | cut -d. -f1) | ||
| MINOR=$(echo "$VERSION_PART" | cut -d. -f2) | ||
|
|
||
| # Count commits since the base tag | ||
| PATCH=$(git rev-list "$LATEST_TAG"..HEAD --count) | ||
|
|
||
| if [ "$PATCH" -eq 0 ]; then | ||
| echo "No commits since $LATEST_TAG. Nothing to release." | ||
| exit 0 | ||
| fi | ||
|
|
||
| NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}" | ||
| TAG="v$NEW_VERSION" | ||
| echo "Creating tag: $TAG (from base tag $LATEST_TAG + $PATCH commits)" | ||
|
|
||
| git tag -a "$TAG" -m "Release $TAG" | ||
| git push "https://x-access-token:${GH_TOKEN}@github.com/$REPOSITORY" "$TAG" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.