Skip to content

Commit 659478c

Browse files
committed
Fix 'owner' and 'repo' for the lock workflow
1 parent b27c0e2 commit 659478c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/lock.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ jobs:
2323
const _FOUR_WEEKS_MILLISECONDS = 28 * 24 * 60 * 60 * 1000;
2424
const _FOUR_WEEKS_DATE = new Date(Date.now() - _FOUR_WEEKS_MILLISECONDS);
2525
const FOUR_WEEKS_AGO = `${_FOUR_WEEKS_DATE.toISOString().substring(0, 10)}T00:00:00Z`;
26+
const OWNER = context.repo.repo;
27+
const REPO = context.repo.owner;
2628
2729
try {
28-
const {owner, repo} = github.context.repo;
2930
for (const thread_type of ["issue", "pr"]) {
3031
core.debug(`Finding ${thread_type}s to lock`);
3132
const query = thread_type === "issue"
32-
? `repo:${owner}/${repo} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:issue`
33-
: `repo:${owner}/${repo} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:pr`;
33+
? `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:issue`
34+
: `repo:${OWNER}/${REPO} updated:<${FOUR_WEEKS_AGO} is:closed is:unlocked is:pr`;
3435
core.debug(`Using query '${query}'`);
3536
// https://octokit.github.io/rest.js/v21/#search-issues-and-pull-requests
3637
const {data: {items: results}} = await github.rest.search.issuesAndPullRequests({
@@ -45,8 +46,8 @@ jobs:
4546
core.debug(`Locking #${thread_num} (${thread_type})`);
4647
// https://octokit.github.io/rest.js/v21/#issues-lock
4748
await github.rest.issues.lock({
48-
owner,
49-
repo,
49+
OWNER,
50+
REPO,
5051
issue_number: thread_num,
5152
lock_reason: "resolved",
5253
});

0 commit comments

Comments
 (0)