mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
21 lines
511 B
TypeScript
21 lines
511 B
TypeScript
import { exec } from "@actions/exec";
|
|
import path from "node:path";
|
|
|
|
import pkgJson from "../package.json" with { type: "json" };
|
|
|
|
const tag = `v${pkgJson.version}`;
|
|
const releaseLine = `built-${process.env.GITHUB_REF_NAME}`;
|
|
|
|
process.chdir(path.join(import.meta.dirname, ".."));
|
|
|
|
await exec("git", ["checkout", "--detach"]);
|
|
await exec("git", ["add", "--force", "dist"]);
|
|
await exec("git", ["commit", "-m", tag]);
|
|
|
|
await exec("git", [
|
|
"push",
|
|
"--force",
|
|
"origin",
|
|
`HEAD:refs/heads/${releaseLine}`,
|
|
]);
|