Skip to content

Commit 17c31ff

Browse files
Copilotpelikhan
andauthored
Fix changesets workflow - Remove duplicate tag creation and update job dependencies (#13592)
* Initial plan * Fix changeset script - remove duplicate tag creation The changeset.js script was trying to create a git tag that already exists, causing the GitHub Actions workflow to fail. The workflow's release job creates the tag first, then the changesets job calls changeset.js which tried to create the same tag again. Changes: - Removed tag creation (git tag -a) from changeset.js - Removed tag push (git push origin <tag>) from changeset.js - Updated error recovery instructions to not mention tag operations - Added documentation clarifying the script expects tags to be pre-created The script now only updates CHANGELOG.md, deletes changeset files, commits changes, and pushes to main - no tag operations. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Update changesets job to depend on agent job The changesets job now runs after the agent job completes, ensuring release highlights are generated before the CHANGELOG is updated. Before: agent -> depends on changesets After: changesets -> depends on agent This allows the agent to generate release highlights first, then the CHANGELOG can be updated with the full context. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent 1d0c192 commit 17c31ff

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

.github/workflows/release.lock.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ jobs:
303303
provenance: mode=max
304304

305305
changesets:
306-
needs: ["activation", "config", "release"]
306+
needs: ["activation", "config", "release", "agent"]
307307
runs-on: ubuntu-latest
308308
permissions:
309309
contents: write

scripts/changeset.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
*
1010
* Example:
1111
* node changeset.js release v1.2.3 --yes
12+
*
13+
* Note: This script does NOT create or push git tags. Tags should be created by the caller
14+
* (e.g., the GitHub Actions workflow) before running this script. This script only updates
15+
* CHANGELOG.md, deletes changeset files, commits the changes, and pushes to the main branch.
1216
*/
1317

1418
const fs = require("fs");
@@ -492,21 +496,13 @@ async function runRelease(versionTag, skipConfirmation = false) {
492496
console.log(formatInfoMessage("Committing changes..."));
493497
execSync(`git commit -m "Release ${versionString}"`, { encoding: "utf8" });
494498

495-
// Create tag
496-
console.log(formatInfoMessage("Creating tag..."));
497-
execSync(`git tag -a ${versionString} -m "Release ${versionString}"`, { encoding: "utf8" });
498-
499499
// Push commit to remote
500500
console.log(formatInfoMessage("Pushing commit..."));
501501
execSync("git push", { encoding: "utf8" });
502502

503-
// Push tag
504-
console.log(formatInfoMessage("Pushing tag..."));
505-
execSync(`git push origin ${versionString}`, { encoding: "utf8" });
506-
507503
console.log("");
508504
console.log(formatSuccessMessage(`Successfully released ${versionString}`));
509-
console.log(formatSuccessMessage("Commit and tag pushed to remote"));
505+
console.log(formatSuccessMessage("Commit pushed to remote"));
510506
} catch (error) {
511507
console.log("");
512508
console.error(formatErrorMessage("Git operation failed: " + error.message));
@@ -518,9 +514,7 @@ async function runRelease(versionTag, skipConfirmation = false) {
518514
console.log(` git add CHANGELOG.md`);
519515
}
520516
console.log(` git commit -m "Release ${versionString}"`);
521-
console.log(` git tag -a ${versionString} -m "Release ${versionString}"`);
522517
console.log(` git push`);
523-
console.log(` git push origin ${versionString}`);
524518
process.exit(1);
525519
}
526520
}

0 commit comments

Comments
 (0)