Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59a5020
commit 711ca79
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Check Broken Links | ||
|
||
on: | ||
schedule: | ||
- cron: "0 2 * * 0" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
linkcheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check links with linkcheck | ||
uses: filiph/linkcheck@3.0.0 | ||
with: | ||
arguments: https://www.mirhamasala.com --external --skip-file linkcheck-skip-file.txt > linkcheck-results.txt | ||
id: linkcheck | ||
|
||
- name: Upload linkcheck-results.txt as artifact | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: linkcheck-results | ||
path: linkcheck-results.txt | ||
|
||
- name: Create GitHub issue | ||
if: ${{ failure() }} | ||
uses: dacbd/create-issue-action@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: "Content issue: Broken links found" | ||
body: | | ||
**Describe the issue** | ||
During our scheduled (or manually-triggered) link check, the workflow named `check-broken-links` identified one or more broken links in the repository. | ||
Details of the broken links, including their locations and the reasons for failure, can be found in the `linkcheck-results.txt` artifact, following the failed run link below. | ||
[Failed Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
[Codebase](https://github.com/${{ github.repository }}/tree/${{ github.sha }}) | ||
🔗 Workflow name - `${{ github.workflow }}` | ||
📇 Job - `${{ github.job }}` | ||
🚦 Status - `${{ job.status }}` | ||
labels: "content" | ||
assignees: mirhamasala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ================================ | ||
# linkcheck-skip-file | ||
# ================================ | ||
# | ||
# Purpose: | ||
# This file is part of a GitHub Actions workflow named "Check Broken Links". It contains a list of URLs or links that | ||
# are intended to be skipped during the automated link-checking process. | ||
# | ||
# Instructions: | ||
# - Add the links that should be skipped by the "Check Broken Links" workflow to this file. | ||
# - Each link should be on a new line. | ||
# - Clearly document the reason for skipping each link. | ||
# - Avoid using this file to bypass issues that can be resolved by correcting or updating the link. | ||
# | ||
# The workflow runs a job named "linkcheck" on a schedule and manually (workflow_dispatch). If the job fails, | ||
# it uploads the results as an artifact and creates a GitHub issue notifying of the broken links found. | ||
# | ||
# Format: | ||
# <URL> # Reason for skipping | ||
# | ||
# Example: | ||
# http://example-broken-link.com # Broken link, site is down | ||
# | ||
# ================================ | ||
|
||
^https://www\.mirhamasala\.com/_next/.* | ||
.*facebook\.com.* | ||
.*instagram\.com.* | ||
.*twitter\.com.* |
711ca79
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.
Successfully deployed to the following URLs:
mirhamasala – ./
www.mirhamasala.com
mirhamasala-mirhamasala.vercel.app
mirhamasala-git-main-mirhamasala.vercel.app
mirhamasala.com
mirhamasala.vercel.app