Added fallback filename if workflow fails to get github filepath due to runner issues

This commit is contained in:
Jaiveer Katariya
2022-12-08 12:33:25 -05:00
parent 1403cdbeae
commit 55e9785fea
+8 -1
View File
@@ -150,8 +150,15 @@ export async function annotateAndLabelResources(
resourceTypes: Resource[],
allPods: any
) {
const defaultWorkflowFileName = 'k8s-deploy-failed-workflow-annotation'
const githubToken = core.getInput('token')
const workflowFilePath = await getWorkflowFilePath(githubToken)
let workflowFilePath
try {
workflowFilePath = await getWorkflowFilePath(githubToken)
} catch (ex) {
core.warning(`Failed to extract workflow file name: ${ex}`)
workflowFilePath = defaultWorkflowFileName
}
const deploymentConfig = await getDeploymentConfig()
const annotationKeyLabel = getWorkflowAnnotationKeyLabel()