Skip to content

Commit

Permalink
fix(patch releases): update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 23, 2024
1 parent 9a3f0df commit f88bc3c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/patch_missing_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,42 @@ jobs:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
// get all repos in the org
console.log(`Getting repos for org: ${context.repo.owner}`)
const repos_opts = github.rest.repos.listForOrg.endpoint.merge({
org: context.repo.owner,
})
const repos = await github.paginate(repos_opts)
console.log(`Found ${repos.length} repos`)
// iterate over repos
for (const repo of repos.data) {
for (const repo of repos) {
console.log('--------------------------')
console.log(`Updating releases for repo: ${repo.name}`)
// tags still exist and they match releases
// get all tags for the repo
console.log(`Getting tags for repo: ${repo.name}`)
const tags_opts = github.rest.repos.listTags.endpoint.merge({
owner: context.repo.owner,
repo: repo.name
})
const tags = await github.paginate(tags_opts)
console.log(`Found ${tags.length} tags`)
// iterate over tags
for (const tag of tags.data) {
for (const tag of tags) {
console.log(`Updating release for tag: ${tag.name}`)
// 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({
owner: context.repo.owner,
repo: repo.name,
Expand Down

0 comments on commit f88bc3c

Please sign in to comment.