-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: fetch the tags and push each one individually #195
Open
WeslleyNasRocha
wants to merge
6
commits into
un-ts:main
Choose a base branch
from
WeslleyNasRocha:fix/gitlab-pipelines-limitation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a9c902
fix: fetch the tags and push each one individually
WeslleyNasRocha 1037916
fix: add changeset
a521ca5
fix: simplify pushTags function by using HEAD directly for tag retrieval
WeslleyNasRocha 71dd454
fix: add check for empty tag list before pushing tags to remote
WeslleyNasRocha d538594
fix: add early return for empty tag list in pushTags function
WeslleyNasRocha 0e86e4a
feat: add INPUT_PUSH_ALL_TAGS option and refactor tag pushing logic
WeslleyNasRocha 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 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,5 @@ | ||
--- | ||
'changesets-gitlab': minor | ||
--- | ||
|
||
fetch the tags and push each one individually |
This file contains 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 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 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 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 |
---|---|---|
|
@@ -60,6 +60,7 @@ interface PublishOptions { | |
script: string | ||
gitlabToken: string | ||
createGitlabReleases?: boolean | ||
pushAllTags?: boolean | ||
cwd?: string | ||
} | ||
|
||
|
@@ -82,6 +83,7 @@ export async function runPublish({ | |
script, | ||
gitlabToken, | ||
createGitlabReleases = true, | ||
pushAllTags = true, | ||
cwd = process.cwd(), | ||
}: PublishOptions): Promise<PublishResult> { | ||
const api = createApi(gitlabToken) | ||
|
@@ -93,7 +95,9 @@ export async function runPublish({ | |
{ cwd }, | ||
) | ||
|
||
await gitUtils.pushTags() | ||
if (pushAllTags) { | ||
await gitUtils.pushTags() | ||
} | ||
|
||
const { packages, tool } = await getPackages(cwd) | ||
const releasedPackages: Package[] = [] | ||
|
@@ -113,6 +117,11 @@ export async function runPublish({ | |
|
||
if (match) { | ||
releasedPackages.push(pkg) | ||
if (!pushAllTags) { | ||
await gitUtils.pushTag( | ||
`${pkg.packageJson.name}@${pkg.packageJson.version}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tag should be only And we can actually leave to use |
||
) | ||
} | ||
if (createGitlabReleases) { | ||
await createRelease(api, { | ||
pkg, | ||
|
@@ -142,6 +151,13 @@ export async function runPublish({ | |
} | ||
releasedPackages.push(pkg) | ||
} | ||
if (!pushAllTags) { | ||
for (const pkg of releasedPackages) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would |
||
await gitUtils.pushTag( | ||
`${pkg.packageJson.name}@${pkg.packageJson.version}`, | ||
) | ||
} | ||
} | ||
if (createGitlabReleases) { | ||
await Promise.all( | ||
releasedPackages.map(pkg => | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.