github-actions-parser icon indicating copy to clipboard operation
github-actions-parser copied to clipboard

runs-on can contain any custom label

Open davetapley opened this issue 4 years ago • 4 comments

Per the docs:

if you have a job that requires a specific type of graphics hardware, you can create a custom label called gpu ... This example shows a job that combines default and custom labels:

    runs-on: [self-hosted, gpu]

But that makes vscode-github-actions complain:

'gpu' is not in the list of allowed values

presumably because gpu isn't in this list:

https://github.com/cschleiden/github-actions-parser/blob/a4679ecb4f0c38990f1c4f9a558928bc2b45ce44/src/lib/workflowschema/workflowSchema.ts#L152-L155


I fear the existence of custom labels means that list ⬆️ will have to go away? 😬

davetapley avatar Oct 07 '21 16:10 davetapley

That's the default list, the API calls below: https://github.com/cschleiden/github-actions-parser/blob/a4679ecb4f0c38990f1c4f9a558928bc2b45ce44/src/lib/workflowschema/workflowSchema.ts#L165 try to get the correct set of labels from the runner API.

If that fails, however, something like gpu would not be recognized. I think it would need some kind of intermediate state, if the API call fails, the unrecognized label should get a warning or an information that it's not a default label but that the custom labels could not be retrieved.

cschleiden avatar Oct 07 '21 20:10 cschleiden

Oh interesting, I didn't realize it was that smart!

I now see it isn't picking up our org runner, so that makes sense. Is this token error ⬇️ a clue? Worth a separate issue?

Screen Shot 2021-10-08 at 1 38 14 PM

davetapley avatar Oct 08 '21 20:10 davetapley

There is a setting for org features, if that's enabled the extension should try to request a token with admin:org scope. Unfortunately there is no simple scope that only allows read of org secrets/runners, so it has to be that one:

image

But I admit, this is not really the most user friendly part of the extension.

cschleiden avatar Oct 08 '21 21:10 cschleiden

@cschleiden aha, okay so I enabled that, and while I do now see our org secrets I still don't see org runners, but perhaps tellingly this popped up:

Screen Shot 2021-10-09 at 7 00 01 PM

Any useful logs I can look at? 🤔

davetapley avatar Oct 10 '21 02:10 davetapley