Skip to content

Lint GitHub Actions workflows#125

Merged
Mrtenz merged 6 commits into
mainfrom
mrtenz/lint-github-actions
Oct 25, 2022
Merged

Lint GitHub Actions workflows#125
Mrtenz merged 6 commits into
mainfrom
mrtenz/lint-github-actions

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Oct 12, 2022

This adds actionlint to automatically lint GitHub Actions workflows. This can catch potential errors such as the one caused in #123.

@Mrtenz Mrtenz requested a review from a team as a code owner October 12, 2022 05:09
@Mrtenz

This comment was marked as outdated.

@Mrtenz Mrtenz force-pushed the mrtenz/lint-github-actions branch from 0ac3cae to 70ede45 Compare October 12, 2022 13:06
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Download actionlint
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think about including these steps in the job above so that we don't have to check the repo out again?

If we want to keep this separate: I notice you bumped the version of actions/checkout in this job. Do we want to also change the version of actions/checkout above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What do you think about including these steps in the job above so that we don't have to check the repo out again?

I think it's a good time to start parallelising different steps, like we're doing in MetaMask/core#941. Will try to use a similar approach for this!

If we want to keep this separate: I notice you bumped the version of actions/checkout in this job. Do we want to also change the version of actions/checkout above?

Probably a good idea, since v2 is deprecated, AFAIK.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I just realised that we'll need to check out the repo again regardless if we want to parallelise it. Linting the workflows doesn't require a Yarn install either, so there's no need to change it.

Will still bump the actions/checkout version though!

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

Did a test run here, and it correctly flagged an invalid property: https://github.com/MetaMask/metamask-module-template/actions/runs/3321724280/jobs/5489762237

@Mrtenz Mrtenz merged commit 163351b into main Oct 25, 2022
@Mrtenz Mrtenz deleted the mrtenz/lint-github-actions branch October 25, 2022 15:44
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.

3 participants