-
Notifications
You must be signed in to change notification settings - Fork 23
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
Upgrade link-check to 0.12 #271
Conversation
Link Check ReportThere were no links to check! |
@@ -0,0 +1,12 @@ | |||
module.exports = async ({ github, context }) => { |
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.
given this is used only in one place, is it better to inline it in the yml file instead?
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.
The only real reason to keep this separate was so that linters and such can more easily read the js used for the action than they could for js inside a yaml string.
It's also currently duplicated across all the sites which isn't ideal, I'm happy to hear any suggestions for a better implementation because it's going to need one soon.
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 it's used a lot across repos, it sounds worth creating a separate actions repo? Something like https://github.com/iterative/get-pr-number. Then usage would be:
- id: pr-number
uses: iterative/get-pr-number@v1
...
- run: echo ${{ steps.pr-number.outputs.result }}
Or we could have a mono-repo for actions (https://github.com/iterative/actions):
- id: pr-number
uses: iterative/actions/get-pr-number@v1
...
- run: echo ${{ steps.pr-number.outputs.result }}
(vis. https://github.com/int128/typescript-actions-monorepo/tree/main/hello-world)
body-includes: "<h1 id=\"link-check\">Link Check Report</h1>" | ||
|
||
- name: Create or update comment | ||
uses: peter-evans/create-or-update-comment@v2 |
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.
@iterative/cml if this action can update a comment without a user-provided PAT, why can't cml?
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.
The one thing I could see in the code is that create-or-update-comment
gets its octokit
through @actions/github
's core.getOctokit
while CML's GitHub driver gets it through @octokit/rest
's Octokit
constructor, seemingly in order to add the throttling plugin.
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.
@casperdcl Different kinds of comments, comment on a commit vs comment on a pr?
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.
Different kinds of comments
if that's the issue (a commit-comment requires less perms than pr-comment) then shouldn't --pr
should fallback to commit-comment + warning rather than just failing?
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.
There's an action that creates commit comments which, if the docs are to be believed can also take the GHA token
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.
opened iterative/cml#1105
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.
Looks good on my end.
See iterative/dvc.org#3700 for more info
This will need some improvements, but solves a lot of issues as-is