Skip to content

Commit 9d2d08e

Browse files
authored
Merge pull request #22 from rajatjindal/debug-releaser
debug releaser
2 parents f31d0e1 + 53cf2c6 commit 9d2d08e

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

.github/workflows/pr-check-dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v4
1616
with:
1717
node-version: 20
1818

.github/workflows/release-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

1515
- run: |
1616
echo "GITHUB_REF is $GITHUB_REF"

dist/index.js

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

src/release.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const encode = (str: string): string =>
4242

4343
async function run(): Promise<void> {
4444
try {
45-
const tagName = getReleaseTagName()
46-
const version = getVersion(tagName)
45+
const tempTagName = getReleaseTagName()
46+
const version = getVersion(tempTagName)
4747
const indent = parseInt(core.getInput('indent') || DEFAULT_INDENT)
4848
const allReleases = await octokit.rest.repos.listReleases({
4949
owner: github.context.repo.owner,
@@ -55,12 +55,18 @@ async function run(): Promise<void> {
5555
await addDelay(10 * 1000)
5656

5757
const release = allReleases.data.find(
58-
item => item.tag_name === tagName || item.tag_name === `v${tagName}`
58+
item =>
59+
item.tag_name === tempTagName || item.tag_name === `v${tempTagName}`
5960
)
6061
if (!release) {
61-
throw new Error(`no release found with tag ${tagName} or v${tagName}`)
62+
throw new Error(
63+
`no release found with tag ${tempTagName} or v${tempTagName}`
64+
)
6265
}
6366

67+
// use the tag from the release
68+
const tagName = release.tag_name
69+
6470
const releaseMap = new Map<string, string>()
6571
for (const asset of release?.assets || []) {
6672
core.info(`calculating sha of ${asset.browser_download_url}`)
@@ -147,8 +153,9 @@ async function run(): Promise<void> {
147153
return
148154
}
149155

150-
core.info('making webhook request to create PR')
151-
await httpclient.post(RELEASE_BOT_WEBHOOK_URL, JSON.stringify(releaseReq))
156+
const rawBody = JSON.stringify(releaseReq)
157+
core.info(`making webhook request to create PR ${rawBody}`)
158+
await httpclient.post(RELEASE_BOT_WEBHOOK_URL, rawBody)
152159
} catch (error) {
153160
if (error instanceof Error) core.setFailed(error.message)
154161
}

0 commit comments

Comments
 (0)