Skip to content

Commit 4affc52

Browse files
authored
fix dangling prs script (#53859)
1 parent f301f9a commit 4affc52

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/workflows/close-dangling-prs.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { program, Option } from 'commander'
22

33
import github from './github.js'
4-
import { getActionContext } from './action-context.js'
54
import { octoSecondaryRatelimitRetry } from './secondary-ratelimit-retry'
65

76
const DRY_RUN = process.env.DRY_RUN || 'false'
@@ -32,19 +31,13 @@ const CONFIGS: Config[] = [
3231
},
3332
]
3433

35-
let owner = 'github'
36-
let repo = 'docs-internal'
37-
38-
if (process.env.GITHUB_EVENT_PATH) {
39-
const actionContext = getActionContext()
40-
owner = actionContext.owner
41-
repo = actionContext.repo
42-
}
34+
const owner = process.env.GITHUB_REPOSITORY_OWNER || 'github'
35+
const repo = process.env.GITHUB_REPOSITORY?.split('/')[1] || 'docs-internal'
4336

4437
program
4538
.description('Finds PRs with "FOR PREVIEW ONLY" in the title that are too old and closes them.')
46-
.option('owner', 'Owner of the repository', owner)
47-
.option('repo', 'Name of the repository', repo)
39+
.option('--owner', 'Owner of the repository', owner)
40+
.option('--repo', 'Name of the repository', repo)
4841
.addOption(
4942
new Option(
5043
'--dry-run',

0 commit comments

Comments
 (0)