Skip to content

Commit

Permalink
release-sync: Change release tag and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Feb 7, 2024
1 parent eebf7e2 commit 56f62a5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'release', 'automated' ],
labels: ['pending-release'],
state: 'open'
});
Expand All @@ -63,17 +63,15 @@ jobs:
});
}
} else if (!have_release) {
const issueBody = issues.length === 0 ?
`The main branch has commits that haven't been released yet. Here are the commits:\n\n${commitsSinceLastRelease}\n\nPlease prepare a new release.` :
`Update: New commits have been detected on the main branch. Here are the additional commits:\n\n${commitsSinceLastRelease}\n\nPlease update the release preparation.`;
const issueBody = `New commits have been detected on the main branch since the latest release:\n\n${commitsSinceLastRelease}\n\nPlease consider a new release.`;
if (issues.length === 0) {
// Create a new issue if none exists
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Pending Release Notification',
body: issueBody,
labels: ['release', 'automated']
labels: ['pending-release']
});
} else {
// Update the existing issue with new commits
Expand All @@ -83,5 +81,12 @@ jobs:
issue_number: issues[0].number,
body: issueBody
});
// Add extra comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issues[0].number,
body: "More commits detected"
})
}
}

0 comments on commit 56f62a5

Please sign in to comment.