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

Make Actionlint Directly Invokable as an Action Itself #479

Closed
wants to merge 172 commits into from

Conversation

norwd
Copy link
Contributor

@norwd norwd commented Nov 18, 2024

Currently, there are two ways of running actionlint in a GitHub Action workflow:

  1. Running the download script to install actionlint and execute it from a run: step:
    - name: Check workflow files
      shell: bash
      run: |
        bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
        ./actionlint -color
  2. Running actionlint from a docker container
    - name: Check workflow files
      uses: docker://rhysd/actionlint:latest
      with:
        args: -color

Both of these two options have some drawbacks. Option 1 requires either always running the download script from the main branch (which may be unstable), or specifying a stable tag (which needs to be manually updated when new versions are released as Dependabot won't suggest updates). Option 2 has the benefit of being tied to a stable version, e.g. docker://rhysd/actionlint:v<TAG>, however, it can only be configured by passing in the args: property as a monolithic string, instead of separate inputs with clear defaults and descriptions.

This pull request solves this by adding an action.yml file to the root that defines inputs: and executes actionlint internally. Essentially wrapping a run actionlint from a workflow. The key benefits here are clearly defined inputs and enabling Dependabot updates.

This resolves #262

This will allow the repo to be used as an action, the branding can be added if this ever goes on the marketplace.
This might fix the issue where the `:` character gets detected as a yaml mapping value, which this is not.
@rhysd
Copy link
Owner

rhysd commented Nov 18, 2024

Adding an action to this repository is confusing because tags of this repository are for actionlint command line tool. For example, adding a new feature to the action causes a minor version bump even if the actionlint command has no new features.

Currently actionlint can be used with only two steps; download it and just run it.

https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions

I don't feel the benefit of just converting the two steps into one is a compelling argument against the problem I explained above.

@norwd
Copy link
Contributor Author

norwd commented Nov 18, 2024

Adding an action to this repository is confusing because tags of this repository are for actionlint command line tool. For example, adding a new feature to the action causes a minor version bump even if the actionlint command has no new features.

Currently actionlint can be used with only two steps; download it and just run it.

https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions

I don't feel the benefit of just converting the two steps into one is a compelling argument against the problem I explained above.

That's fair 🙂, I just thought since I had a fork lying around I might as well offer to merge it. Feel free to close this and the linked issue.

@rhysd
Copy link
Owner

rhysd commented Nov 19, 2024

Keeping the fork or creating a separate repository for it sounds much better than merging this. Thank you for making the action 👍. Then closing.

@rhysd rhysd closed this Nov 19, 2024
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.

Make Actionlint Directly Invokable as an Action Itself
2 participants