@@ -4,7 +4,7 @@ import * as retry from "@octokit/plugin-retry";
44import consoleLogLevel from "console-log-level" ;
55
66import { getActionVersion , getRequiredInput } from "./actions-util" ;
7- import { parseRepositoryNwo } from "./repository" ;
7+ import { getRepositoryNwo } from "./repository" ;
88import {
99 ConfigurationError ,
1010 getRequiredEnvParam ,
@@ -123,17 +123,15 @@ export async function getGitHubVersion(): Promise<GitHubVersion> {
123123 * Get the path of the currently executing workflow relative to the repository root.
124124 */
125125export async function getWorkflowRelativePath ( ) : Promise < string > {
126- const repo_nwo = getRequiredEnvParam ( "GITHUB_REPOSITORY" ) . split ( "/" ) ;
127- const owner = repo_nwo [ 0 ] ;
128- const repo = repo_nwo [ 1 ] ;
126+ const repo_nwo = getRepositoryNwo ( ) ;
129127 const run_id = Number ( getRequiredEnvParam ( "GITHUB_RUN_ID" ) ) ;
130128
131129 const apiClient = getApiClient ( ) ;
132130 const runsResponse = await apiClient . request (
133131 "GET /repos/:owner/:repo/actions/runs/:run_id?exclude_pull_requests=true" ,
134132 {
135- owner,
136- repo,
133+ owner : repo_nwo . owner ,
134+ repo : repo_nwo . repo ,
137135 run_id,
138136 } ,
139137 ) ;
@@ -218,9 +216,7 @@ export async function listActionsCaches(
218216 key : string ,
219217 ref : string ,
220218) : Promise < ActionsCacheItem [ ] > {
221- const repositoryNwo = parseRepositoryNwo (
222- getRequiredEnvParam ( "GITHUB_REPOSITORY" ) ,
223- ) ;
219+ const repositoryNwo = getRepositoryNwo ( ) ;
224220
225221 return await getApiClient ( ) . paginate (
226222 "GET /repos/{owner}/{repo}/actions/caches" ,
@@ -235,9 +231,7 @@ export async function listActionsCaches(
235231
236232/** Delete an Actions cache item by its ID. */
237233export async function deleteActionsCache ( id : number ) {
238- const repositoryNwo = parseRepositoryNwo (
239- getRequiredEnvParam ( "GITHUB_REPOSITORY" ) ,
240- ) ;
234+ const repositoryNwo = getRepositoryNwo ( ) ;
241235
242236 await getApiClient ( ) . rest . actions . deleteActionsCacheById ( {
243237 owner : repositoryNwo . owner ,
0 commit comments