-
Notifications
You must be signed in to change notification settings - Fork 509
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
AO3-6590 Add reviewdog for linting ERB files #4604
Conversation
As is, the workflow fails in this repository:
See GitHub Actions docs on Allowing select actions and reusable workflows to run. |
It doesn't work. And if that would be fixed in the future, it would be linting twice.
bundler-cache: true | ||
|
||
- name: erb-lint | ||
uses: tk0miya/action-erblint@667687e73b44e7b7a710a1204b180f49f80ebb5e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use @v1
? https://github.com/tk0miya/action-erblint/releases/tag/v1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't trust the creator of the action, it's usually best practices to use the hash version for actions, because it refers to a specific commit. That means that you can view the repository, read the source code of the action, and be sure that when the action runs, it's running only code that you've already reviewed.
Tags, on the other hand, can be switched to point to a different commit, which means that the owner of the action could choose to replace the existing code with some kind of exploit.
I'm not sure the extra security is necessary, in this case, but I can see both sides of the argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub recommends using a SHA in their docs, especially if the action author is not a verified creator, like in this case.
However, this workflow has very few permissions ("write checks" for PRs from the same repo, "read checks" for third party repos), so if it were compromised I don't think it could do much harm. But I'd rather be safe than sorry, because github actions and their permissions are relatively new to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough! Thanks for the link @Bilka2!
* AO3-6590 Add reviewdog ERB lint runner * AO3-6590 Remove erb lint from Hound It doesn't work. And if that would be fixed in the future, it would be linting twice. * AO3-6590 Rename reviewdog workflow to be more generic
* AO3-6590 Add reviewdog ERB lint runner * AO3-6590 Remove erb lint from Hound It doesn't work. And if that would be fixed in the future, it would be linting twice. * AO3-6590 Rename reviewdog workflow to be more generic
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing
)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-6590
Purpose
Use reviewdog to run ERB lint on pull requests because Hound does not run it (despite being configured for it).
Demo PR from same repo: Bilka2#1
Demo PR from forked repo: Bilka2#2 (see reviewdog's docs on Graceful degradation for PRs from forks)
Testing Instructions
See Jira.
Credit
Bilka (he/him)