mirror of
https://github.com/Azure/setup-helm.git
synced 2026-04-05 14:26:57 +00:00
fix auth (#86)
This commit is contained in:
parent
484a64052d
commit
17cd77473c
5 changed files with 53 additions and 1 deletions
|
|
@ -10,6 +10,8 @@ import * as fs from 'fs'
|
|||
import * as toolCache from '@actions/tool-cache'
|
||||
import * as core from '@actions/core'
|
||||
import {graphql} from '@octokit/graphql'
|
||||
import {createActionAuth} from '@octokit/auth-action'
|
||||
import {create} from 'domain'
|
||||
|
||||
const helmToolName = 'helm'
|
||||
const stableHelmVersion = 'v3.9.0'
|
||||
|
|
@ -49,7 +51,11 @@ export function getValidVersion(version: string): string {
|
|||
// Gets the latest helm version or returns a default stable if getting latest fails
|
||||
export async function getLatestHelmVersion(): Promise<string> {
|
||||
try {
|
||||
const {repository} = await graphql(
|
||||
const auth = createActionAuth()
|
||||
const graphqlAuthenticated = graphql.defaults({
|
||||
request: {hook: auth.hook}
|
||||
})
|
||||
const {repository} = await graphqlAuthenticated(
|
||||
`
|
||||
{
|
||||
repository(name: "helm", owner: "helm") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue