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

Broken Link Checker - Github Action #2404

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

JuanPabloDiaz
Copy link
Contributor

@JuanPabloDiaz JuanPabloDiaz commented Jul 5, 2024

Fixes Issue

Closes #2357

Changes proposed

JuanPabloDiaz#39

Screenshots

image

Note to reviewers

* Check links rupali-codes#2357

* chore: enable workflow_dispatch for check_links.yaml

* test

* broken links

* json files

* json files

* path

* False Positive URL

* add False Positive URL

* add False Positive URL
Copy link

vercel bot commented Jul 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
linkshub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2024 9:20pm

@github-actions github-actions bot added chore Might take time to finish goal: new-link Addition of new links related contributions priority: low Addition of new links/categories or doing any small task (e.g fixing typos) labels Jul 5, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you, JuanPabloDiaz, for creating this pull request and contributing to LinksHub! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

@rupali-codes
Copy link
Owner

@Anmol-Baranwal @CBID2 could you please review it

Copy link
Collaborator

@CBID2 CBID2 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 to me. What do you think @Anmol-Baranwal?

@JuanPabloDiaz
Copy link
Contributor Author

After completing the pull request, I realized it would be beneficial to extend the functionality by running the workflow whenever a pull request is opened to check the URLs as well. This feature is likely already configured in my workflow, but I haven't found a way to test it yet.

@Anmol-Baranwal
Copy link
Collaborator

After completing the pull request, I realized it would be beneficial to extend the functionality by running the workflow whenever a pull request is opened to check the URLs as well. This feature is likely already configured in my workflow, but I haven't found a way to test it yet.

I want a clear overview of how it works and what exactly you are trying to do.

Will it open a PR if there are broken URLs in the repo? What exactly will happen? Just let me know so I can check the docs and necessary links to help.

@JuanPabloDiaz
Copy link
Contributor Author

Sure @Anmol-Baranwal,

This workflow is designed to automatically check for broken links in Markdown and JSON files within the repository. It runs under several conditions: 1. on pull requests to the 'main' branch, 2. on pushes to the 'main' branch, 3. on manual triggers, and 4. on a scheduled basis (every Monday at 12:30 UTC). If any broken links are found, the workflow creates or updates a GitHub issue with the details.

@JuanPabloDiaz
Copy link
Contributor Author

In addition...

Link Checker:

The Link Checker step reads the .lycheeignore file specified by the --exclude-file .lycheeignore argument to determine which links or files should be excluded from the link checking process.

What Happens if Broken Links are Found

If broken links are detected during any of the trigger events, the workflow will:

  1. Check if there is an existing open issue with the label automated-link-issue.
  2. If an existing issue is found, it will update this issue with the details of the broken links.
  3. If no existing issue is found, it will create a new issue with the details of the broken links.
  4. The issue will be labeled with automated-link-issue, broken-link, and docs for easy identification and tracking.

@Anmol-Baranwal
Copy link
Collaborator

@JuanPabloDiaz
Thank you! I will check the docs and necessary workflows in a day or two.

@JuanPabloDiaz
Copy link
Contributor Author

@Anmol-Baranwal, I found a simpler workflow that we could use instead (it is clean and easy to understand). I test it in one of my projects and it does the job.

@Anmol-Baranwal
Copy link
Collaborator

Sure. I will check it out.

Let's proceed with this one then.

@Anmol-Baranwal
Copy link
Collaborator

Anmol-Baranwal commented Jul 23, 2024

@rupali-codes
New workflow seems better. I think it's safe to proceed.

Let's merge this quick!

@rupali-codes rupali-codes merged commit b7b963f into rupali-codes:main Jul 25, 2024
11 checks passed
@JuanPabloDiaz JuanPabloDiaz deleted the broken-link-checker branch July 28, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Might take time to finish goal: new-link Addition of new links related contributions priority: low Addition of new links/categories or doing any small task (e.g fixing typos)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Broken Link Checker - Github Action
4 participants