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

added github actions to check broken links #360

Merged
merged 12 commits into from
Nov 27, 2021
Merged

added github actions to check broken links #360

merged 12 commits into from
Nov 27, 2021

Conversation

lakshya8066
Copy link
Contributor

Fixes #357

@Stargator
Copy link
Contributor

I would just looking at one of the following Actions to provide the functionality. I kinda like https://github.com/lycheeverse/lychee-action because it's still active in development. A lot fo the others seemed to have just released one version and forgot about it.

The one you selected, celinekurpershoek/link-checker, hasn't been touched since last October. So I would prefer an active community.

@lakshya8066
Copy link
Contributor Author

Yeah makes sense, I'll update the pr

@Stargator
Copy link
Contributor

@lakshya8066 Thank you

@Stargator
Copy link
Contributor

Marking this as Hacktoberfest accepted since this is a variable update to our workflow and a great amount of research and testing that goes into it.

@Stargator Stargator added the hacktoberfest-accepted Hacktoberfest accepted PR label Nov 1, 2021
@lakshya8066
Copy link
Contributor Author

Thank you @Stargator :)

Copy link
Contributor

@Stargator Stargator left a comment

Choose a reason for hiding this comment

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

Almost ready, just drop the create issue logic and I think this is good.

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Create Issue From File
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to create an issue as if the Workflow fails, we'd just have the PR branch updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh okay, I will update the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be sure, we don't need the environment variable too right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so.

@Stargator
Copy link
Contributor

@lakshya8066 It seems the Links workflow was not executed. Maybe we do need the secret token?

@lakshya8066
Copy link
Contributor Author

Right, let's add it and see...

Co-authored-by: Stargator <7527155+Stargator@users.noreply.github.com>
@Stargator
Copy link
Contributor

@lakshya8066 Yep, now the action is running.

@Stargator
Copy link
Contributor

@lakshya8066 It's working, but there is an error for one link and yet the Action seems to be passed as Successful in the PR. I see it is returning exit code 2, is there someway to ensure it fails on error?

@lakshya8066
Copy link
Contributor Author

lakshya8066 commented Nov 10, 2021

@Stargator yes and I believe it stops checking once it gets a broken link or maybe it is just a coincidence.
It was originally supposed to create an issue for the broken link but even without that, tests should fail for non-zero exit codes.
I'm not sure how to achieve this, however, I think this can be helpful. If there is a way to grab the exit code information, we edit the yml to compare the exit codes with 0 and fail the test accordingly. Somethin like this. What do you think?

lakshya8066 and others added 2 commits November 16, 2021 20:28
Updated to fail the test when a broken link is encountered

Co-authored-by: Stargator <7527155+Stargator@users.noreply.github.com>
added checks for https
@Stargator
Copy link
Contributor

@lakshya8066 I made a few updates to resolve some errors. But now it's failing! YAY! 💯

Last steps now:

  1. Could you replace all http with https?
  2. Update http://exercism.io/languages/dart/help @ErikSchierboom @iHiD, did the help pages get moved? Where should we point users?

@ErikSchierboom
Copy link
Member

@Stargator They can be accessed at https://exercism.org/docs/tracks/dart

@Stargator Stargator self-requested a review November 27, 2021 03:28
@Stargator
Copy link
Contributor

@lakshya8066 I am approving this PR and merging it. But, I need you to understand that normally I would require all the checks to pass. That is why I expected the URLs to be fixed in this branch so the new link checker can verify everything is good.

So do understand in the future for this repo or any future repo you contribute to. If there are fixes related to an existing PR it's probably best to do it all in one branch.

Thanks again for all your work and patience, I really appreciate finally having this action in our workflow. 😄 🥇

@Stargator Stargator merged commit d971cd4 into exercism:main Nov 27, 2021
@lakshya8066
Copy link
Contributor Author

@Stargator absolutely, I will keep that in mind. I realized the same after creating the other PR.
And thanks for supporting and guiding me through the PR! This was indeed an amazing learning experience. ✨
Looking forward to contributing more to the project :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest accepted PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add or Update existing GitHub Action to check for bad links
3 participants