Skip to content

Commit

Permalink
fix(patch-releases): skip non existent releases (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Jan 26, 2024
1 parent 68dfc17 commit 7f5ce2d
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/patch_missing_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,22 @@ jobs:
// get release for tag
console.log(`Getting release for tag: ${tag.name}`)
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: repo.name,
tag: tag.name
})
// edit the release (without making any changes)
console.log(`Editing release for tag: ${tag.name}`)
await github.rest.repos.updateRelease({
try {
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: repo.name,
release_id: release.data.id,
})
tag: tag.name
})
// edit the release (without making any changes)
console.log(`Editing release for tag: ${tag.name}`)
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: repo.name,
release_id: release.data.id,
})
} catch (error) {
console.log(`No release found for tag: ${tag.name}`)
}
}
}

0 comments on commit 7f5ce2d

Please sign in to comment.