Skip to content

Conversation

driazati
Copy link
Contributor

@driazati driazati commented Jul 28, 2021

This integrates https://github.com/rhysd/actionlint which checks workflow files for syntactic validity plus some extra GitHub Action specific semantics. If it sees that ShellCheck is installed it will also pull out each run: block and check it, so this integrates that as well.

Example failure: https://github.com/pytorch/test-infra/runs/3186195613

We can copy-paste this pretty much verbatim into pytorch/pytorch since actionlint finds workflow files automatically.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 28, 2021
@driazati driazati force-pushed the lintact branch 3 times, most recently from 7f4d170 to 066b5b2 Compare July 28, 2021 21:07
@driazati driazati changed the title Lint actions with rhysd/actionlint Lint actions Jul 28, 2021
@driazati driazati requested a review from a team July 28, 2021 21:36
@driazati driazati force-pushed the lintact branch 2 times, most recently from 9084363 to 2ececfe Compare July 28, 2021 21:47
Copy link
Contributor

@janeyx99 janeyx99 left a comment

Choose a reason for hiding this comment

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

🎉

@driazati driazati merged commit 81cc7bf into main Jul 28, 2021
facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Jul 29, 2021
Summary:
This adds a linter for our GitHub actions. When a GitHub Actions workflow has an invalid definition, GitHub doesn't queue the job and doesn't report it as failed, so these can be hard to detect with the usual tools. This adds an explicit job to check if our workflow YAMLs are valid using [https://github.com/rhysd/actionlint](https://github.com/rhysd/actionlint). We deployed a similar check in pytorch/test-infra [here](pytorch/test-infra#89).

This PR enables the linter and fixes all the issues it complained about (it did already catch one bug where we were leaving `CIRCLE_BRANCH` blank when uploading binary size)

Pull Request resolved: #62364

Reviewed By: zhouzhuojie

Differential Revision: D29973928

Pulled By: driazati

fbshipit-source-id: 83b365e98fd6cbdcd75eeb44daf1be1c89056f8d
@zengk95 zengk95 deleted the lintact branch April 13, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants