Skip to content

Commit f519537

Browse files
committed
chore: release script to use short live github token
1 parent 8874f2d commit f519537

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/gitrelease.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const nextTag = `v${nextVersion}`;
88

99
echo`Publishing ${nextVersion} on branch ${branch}`;
1010

11-
// Configure git to use the GitHub token for authentication
12-
await $`git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"`;
11+
// git to use the GitHub token for authentication
12+
await $`git remote set-url origin https://${GITHUB_TOKEN}@github.com/NangoHQ/nango.git`;
13+
await $`git config --global user.email "contact@nango.dev"`;
14+
await $`git config --global user.name "Release Bot"`;
1315

1416
const tagExists = await $`git tag -l ${nextTag}`;
1517
if (tagExists.stdout !== '') {
@@ -30,14 +32,14 @@ echo`Adding file`;
3032
await $`git add -A package.json package-lock.json packages/**/package.json CHANGELOG.md packages/**/lib/version.ts`;
3133

3234
echo`Creating commit`;
33-
await $`git -c user.name="Release Bot" -c user.email="contact@nango.dev" commit --allow-empty --author="Release Bot <contact@nango.dev>" -m ${releaseMessage} `;
35+
await $`git commit --allow-empty --author="Release Bot <contact@nango.dev>" -m ${releaseMessage} `;
3436

3537
echo`Creating tag`;
36-
await $`git -c user.name="Release Bot" -c user.email="contact@nango.dev" tag -a ${nextTag} HEAD -m ${releaseMessage}`;
38+
await $`git tag -a ${nextTag} HEAD -m ${releaseMessage}`;
3739

3840
echo`Pushing`;
3941
await $`git push --follow-tags origin HEAD:refs/heads/${branch}`;
40-
await $`git push --tags`;
42+
await $`git push --tags origin`;
4143

4244
echo`Commit pushed, publishing release...`;
4345
// Push GitHub release

0 commit comments

Comments
 (0)