From 659478c60375ebf97c8244f3ecff6aa79f285f13 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:34:20 +0000 Subject: [PATCH] Fix 'owner' and 'repo' for the lock workflow --- .github/workflows/lock.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 2fcec3636..2cee5c0cf 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -23,14 +23,15 @@ jobs: const _FOUR_WEEKS_MILLISECONDS = 28 * 24 * 60 * 60 * 1000; const _FOUR_WEEKS_DATE = new Date(Date.now() - _FOUR_WEEKS_MILLISECONDS); const FOUR_WEEKS_AGO = `${_FOUR_WEEKS_DATE.toISOString().substring(0, 10)}T00:00:00Z`; + const OWNER = context.repo.repo; + const REPO = context.repo.owner; try { - const {owner, repo} = github.context.repo; for (const thread_type of ["issue", "pr"]) { core.debug(`Finding ${thread_type}s to lock`); const query = thread_type === "issue" - ? `repo:${owner}/${repo} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:issue` - : `repo:${owner}/${repo} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:pr`; + ? `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:issue` + : `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:pr`; core.debug(`Using query '${query}'`); // https://octokit.github.io/rest.js/v21/#search-issues-and-pull-requests const {data: {items: results}} = await github.rest.search.issuesAndPullRequests({ @@ -45,8 +46,8 @@ jobs: core.debug(`Locking #${thread_num} (${thread_type})`); // https://octokit.github.io/rest.js/v21/#issues-lock await github.rest.issues.lock({ - owner, - repo, + OWNER, + REPO, issue_number: thread_num, lock_reason: "resolved", });