File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -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 { getRepositoryNwo } from "./repository" ;
7+ import { getRepositoryNwo , RepositoryNwo } from "./repository" ;
88import {
99 ConfigurationError ,
1010 getRequiredEnvParam ,
@@ -240,6 +240,14 @@ export async function deleteActionsCache(id: number) {
240240 } ) ;
241241}
242242
243+ /** Retrieve all custom repository properties. */
244+ export async function getRepositoryProperties ( repositoryNwo : RepositoryNwo ) {
245+ return getApiClient ( ) . request ( "GET /repos/:owner/:repo/properties/values" , {
246+ owner : repositoryNwo . owner ,
247+ repo : repositoryNwo . repo ,
248+ } ) ;
249+ }
250+
243251export function wrapApiConfigurationError ( e : unknown ) {
244252 if ( isHTTPError ( e ) ) {
245253 if (
Original file line number Diff line number Diff line change 1- import { getApiClient } from "../api-client" ;
1+ import { getRepositoryProperties } from "../api-client" ;
22import { Logger } from "../logging" ;
33import { RepositoryNwo } from "../repository" ;
44
@@ -41,13 +41,7 @@ export async function loadPropertiesFromApi(
4141 repositoryNwo : RepositoryNwo ,
4242) : Promise < RepositoryProperties > {
4343 try {
44- const response = await getApiClient ( ) . request (
45- "GET /repos/:owner/:repo/properties/values" ,
46- {
47- owner : repositoryNwo . owner ,
48- repo : repositoryNwo . repo ,
49- } ,
50- ) ;
44+ const response = await getRepositoryProperties ( repositoryNwo ) ;
5145 const remoteProperties = response . data as GitHubPropertiesResponse ;
5246
5347 if ( ! Array . isArray ( remoteProperties ) ) {
You can’t perform that action at this time.
0 commit comments