Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attribute to enable/disable images #193

Merged
merged 2 commits into from Apr 28, 2022
Merged

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Apr 23, 2022

fixes #159

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@crazy-max crazy-max marked this pull request as ready for review Apr 25, 2022
README.md Outdated
Extended attributes and default values:

```yaml
tags: |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be images here?

Copy link
Member Author

@crazy-max crazy-max Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes good catch

Copy link
Member Author

@crazy-max crazy-max Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be good

for (const field of fields) {
const parts = field
.toString()
.split('=')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =

Copy link
Member Author

@crazy-max crazy-max Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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') }}

Copy link
Member Author

@crazy-max crazy-max Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sounds like a bug then, will take a look, thanks for your feedback

Copy link
Member Author

@crazy-max crazy-max Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucacome Hum I was not able to repro, do you have a link to your repo?

Copy link

@lucacome lucacome Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@crazy-max crazy-max Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@crazy-max crazy-max Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucacome Should be fixed, let me know if it looks good to you. Thanks!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max merged commit b2391d3 into docker:master Apr 28, 2022
20 checks passed
@crazy-max crazy-max deleted the images-opts branch Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to enable/disable images
2 participants