ci(release): use app user (#11038)

* ci(release): set git user

* ci(release): refactor to use app

* ci(release): use only app token

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
ckohen
2025-08-16 14:05:36 -07:00
committed by GitHub
parent 9be62b35c9
commit ac290aea95
2 changed files with 12 additions and 7 deletions

View File

@@ -18,20 +18,19 @@ async function checkRegistry(release: ReleaseEntry) {
async function gitTagAndRelease(release: ReleaseEntry, dry: boolean) {
const tagName = `${release.name === 'discord.js' ? `` : `${release.name}@`}${release.version}`;
// Don't throw, if this exits non-zero it's probably because the tag already exists
await $`git tag ${tagName}`.nothrow();
if (dry) {
info(`[DRY] Tag "${tagName}" created, skipping push and release creation.`);
info(`[DRY] Release would be "${tagName}", skipping release creation.`);
return;
}
await $`git push origin ${tagName}`;
const commitHash = (await $`git rev-parse --short HEAD`.text()).trim();
try {
await octokit?.rest.repos.createRelease({
...context.repo,
tag_name: tagName,
target_commitish: commitHash,
name: tagName,
body: release.changelog ?? '',
generate_release_notes: release.changelog === undefined,