Skip to content

Conversation

@ItsCurulo
Copy link

Summary :
This PR addresses issue #145 by updating the CI pipeline configuration to correctly handle Pull Requests.
Currently, the link checker defaults to the main branch or fails to trigger on PRs, leading to false positives/negatives. This fix ensures the workflow scans the actual code being proposed in the PR.

Changes

  1. Modified Trigger: Added pull_request trigger to ci.yaml.
  2. Fixed Checkout Context: Updated the link_checker job to use ref: ${{ github.event.pull_request.head.sha || github.sha }}. Ths targets the specific commit of the PR.
  3. Safety Check: Added a conditional check (if: github.event_name == 'push' ...) to the deploy job. This prevents the pipeline from attempting to deploy the documentation website during a PR check.

Closes #145

Description for the changelog :
Fixed CI pipeline configuration to correctly handle Link Checker and deployments on Pull Requests.

Declaration:

  • content meets the license for this project
  • AI has not been used, or has been declared, in this pull request

Other info :
Tested in a forked repository. The workflow successfully triggered on the Pull Request and scanned the files as expected.

Output summary from the test run:

Run lycheeverse/lychee-action@v2.7.0
# Summary

| Status | Count |
|----------------|-------|
| 🔍 Total | 2638 |
| ✅ Successful | 1927 |
| ⏳ Timeouts | 0 |
| 🔀 Redirected | 6 |
| 👻 Excluded | 703 |
| ❓ Unknown | 0 |
| 🚫 Errors | 1 |
| ⛔ Unsupported | 1 |

@jgadsden
Copy link
Contributor

jgadsden commented Dec 29, 2025

Hello @ItsCurulo , can you confirm that no AI was used in this pull request? The wording of the pull request and the solution you have proposed have the 'feel' of AI

The solution does not implement a fix for issue #145 - the fix must be in the pull request pipepline

@jgadsden jgadsden self-requested a review December 29, 2025 09:05
Copy link
Contributor

@jgadsden jgadsden left a comment

Choose a reason for hiding this comment

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

the fix needs to be in the pull request pipeline not the commit pipeline

@jgadsden jgadsden marked this pull request as draft December 29, 2025 09:05
@ItsCurulo
Copy link
Author

Hello @jgadsden, thank you for the feedback.
Honestly, since this was my first contribution, I used an AI tool to help me format the pull request description more clearly.
I apologize for the confusion. I thought that ci.yaml handled both workflows, my fault.

@ItsCurulo ItsCurulo marked this pull request as ready for review December 29, 2025 11:53
@ItsCurulo ItsCurulo marked this pull request as draft December 29, 2025 11:54
@ItsCurulo ItsCurulo marked this pull request as ready for review December 29, 2025 11:58
uses: DavidAnson/markdownlint-cli2-action@v22.0.0
with:
config: '.markdownlint.yaml'
config: ".markdownlint.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for a change to double quotes here, as no escape sequences are expected, so can be reverted

with:
python-version: '3.10'
python-version: "3.10"

Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as for line 49

name: Deploy web doc
runs-on: ubuntu-latest

needs: [md_linter, spell_checker]
Copy link
Contributor

Choose a reason for hiding this comment

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

ne need for new line

uses: DavidAnson/markdownlint-cli2-action@v22.0.0
with:
config: '.markdownlint.yaml'
config: ".markdownlint.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

as above, no need for double quotes as there are no escape sequences, same for line 86

- name: Checkout markdown
uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is implied by the pull request action and so is not needed

Copy link
Contributor

@jgadsden jgadsden left a comment

Choose a reason for hiding this comment

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

it would be good to implement this by excluding the 'blob' links that are actually causing the failures when .md files are added / deleted within a pull request
see lycheedocs for how to do this, along with the .lycheeignore file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pull request link-checker automation should check pull request not main

2 participants