attribute to enable/disable images#193
Conversation
| Extended attributes and default values: | ||
|
|
||
| ```yaml | ||
| tags: | |
| for (const field of fields) { | ||
| const parts = field | ||
| .toString() | ||
| .split('=') |
There was a problem hiding this comment.
I think splitting by = makes something like this invalid
name=lucacome/test-foo2,enable=${{ github.event_name == 'pull_request' }}
not sure if you ever meant for it to be supported and I guess I could always have the same condition with other operators like startsWith without using =
There was a problem hiding this comment.
${{ github.event_name == 'pull_request' }} is interpreted upstream by the GitHub Runner logic so it would produce name=lucacome/test-foo2,enable=<true|false> before being passed to the action.
There was a problem hiding this comment.
ah interesting, I thought that was the cause for Error: Image name attribute empty: enable=true that I'm seeing, but then I'm not sure I understand what this error means 😄
I have this and I assumed it wasn't coming from the first one, as it would get the default enable=true, and that it was the second line causing the error.
images: |
name=lucacome/test-foo
name=lucacome/test-foo2,enable=${{ github.event_name == 'pull_request' }}
name=ghcr.io/lucacome/workflows,enable=${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.target, 'aws') }}
There was a problem hiding this comment.
Oh sounds like a bug then, will take a look, thanks for your feedback
There was a problem hiding this comment.
@lucacome Hum I was not able to repro, do you have a link to your repo?
There was a problem hiding this comment.
@crazy-max I have this repo where I test workflows https://github.com/lucacome/workflows/runs/6178399824?check_suite_focus=true
There was a problem hiding this comment.
There was a problem hiding this comment.
@lucacome Should be fixed, let me know if it looks good to you. Thanks!
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
fixes #159
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com