diff --git a/action.yml b/action.yml index 4c1e06f..8ec65e9 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,10 @@ inputs: description: 'Version of helm' required: true default: 'latest' + token: + description: 'Github token' + default: ${{ github.token }} + required: true outputs: helm-path: description: 'Path to the cached helm binary' diff --git a/lib/run.js b/lib/run.js index 3f082b4..cfc6a1f 100644 --- a/lib/run.js +++ b/lib/run.js @@ -132,6 +132,7 @@ function getLatestHelmVersionFor(type) { return __awaiter(this, void 0, void 0, function* () { console.log("Running graphql"); console.log(type); + const token = core.getInput('token', { 'required': true }); const versions = yield graphql_1.graphql(` repository(name:"helm" owner:"helm") { @@ -142,7 +143,11 @@ function getLatestHelmVersionFor(type) { } } } - `); + `, { + headers: { + authorization: token + } + }); console.log(versions); return stableHelmVersion; }); diff --git a/src/run.ts b/src/run.ts index 56eed94..731d835 100644 --- a/src/run.ts +++ b/src/run.ts @@ -109,6 +109,7 @@ async function downloadHelm(version: string): Promise { async function getLatestHelmVersionFor(type) { console.log("Running graphql") console.log(type) + const token = core.getInput('token', { 'required': true }); const versions = await graphql( ` repository(name:"helm" @@ -120,7 +121,12 @@ async function getLatestHelmVersionFor(type) { } } } - ` + `, + { + headers: { + authorization: token + } + } ); console.log(versions); return stableHelmVersion;