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

Upgrade link-check to 0.12 #271

Merged
merged 4 commits into from
Jul 22, 2022
Merged

Upgrade link-check to 0.12 #271

merged 4 commits into from
Jul 22, 2022

Conversation

rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Jul 19, 2022

See iterative/dvc.org#3700 for more info

This will need some improvements, but solves a lot of issues as-is

@rogermparent rogermparent requested a review from a team July 19, 2022 14:38
@rogermparent rogermparent self-assigned this Jul 19, 2022
@shcheklein shcheklein temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 14:38 Inactive
@rogermparent rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 14:51 Inactive
@github-actions
Copy link

github-actions bot commented Jul 19, 2022

Link Check Report

There were no links to check!

@rogermparent rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 15:25 Inactive
@@ -0,0 +1,12 @@
module.exports = async ({ github, context }) => {
Copy link
Contributor

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?

Copy link
Contributor Author

@rogermparent rogermparent Jul 20, 2022

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.

Copy link
Contributor

@casperdcl casperdcl Jul 21, 2022

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
Copy link
Contributor

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?

Copy link
Contributor Author

@rogermparent rogermparent Jul 20, 2022

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.

Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@rogermparent rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 21, 2022 19:25 Inactive
Copy link
Contributor

@yathomasi yathomasi left a 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.

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.

5 participants