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

How to generate an empty object for workflow_dispatch? #2

Closed
armanm opened this issue Jun 5, 2024 · 2 comments · Fixed by #3
Closed

How to generate an empty object for workflow_dispatch? #2

armanm opened this issue Jun 5, 2024 · 2 comments · Fixed by #3

Comments

@armanm
Copy link

armanm commented Jun 5, 2024

I'm trying to generate a workflow which supports manual triggers using workflow_dispatch. For that to happen we need to generate this yml content where workflow_dispatch is an empty object.

on:
  workflow_dispatch:

However this does not seem possible using this package. Both of these variants can not actually produce what is needed for GH linter to be happy.

on: [
  workflow_dispatch: []
]
on: [
  workflow_dispatch: %{}
]
@almirsarajcic
Copy link
Member

Yeah, I have a similar issue where I need

on:
  pull_request:

and, similar to your solution, mine was:

on:
  pull_request: []

(YAML)

on: [
  pull_request: []
]

(Elixir)

Honestly, I don't know how to make the linter happy. Maybe, we can check whether the list is empty, and if it is, then remove it.

@almirsarajcic
Copy link
Member

@armanm, can you try again with

{:github_workflows_generator, github: "optimumBA/github_workflows_generator", branch: "remove_fast_yaml", only: :dev, runtime: false},

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 a pull request may close this issue.

2 participants