Skip to content

Commit

Permalink
Fix findRelease arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
danielemery committed Mar 10, 2024
1 parent 44a5ba9 commit be7600f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/scripts/validate-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
const MAX_PAGE_SEARCH = 5;

/** Find the release with the given tag name. */
async function findRelease(github, targetTagName) {
async function findRelease({ github, context }, targetTagName) {
const { owner, repo } = context.repo;

const releasesIterator = github.paginate.iterator(
github.rest.repos.listReleases,
{
Expand All @@ -29,7 +31,10 @@ async function findRelease(github, targetTagName) {
module.exports = async ({ github, context }, targetReleaseTag) => {
const { owner, repo } = context.repo;

const targetRelease = await findRelease(github, targetReleaseTag);
const targetRelease = await findRelease(
{ github, context },
targetReleaseTag
);
if (!targetRelease) {
throw new Error("No release found for tag: ${{github.ref_name}}");
}
Expand Down

0 comments on commit be7600f

Please sign in to comment.