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

Support annotations #275

Open
dveeden opened this issue Feb 18, 2025 · 1 comment
Open

Support annotations #275

dveeden opened this issue Feb 18, 2025 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@dveeden
Copy link

dveeden commented Feb 18, 2025

Related: lycheeverse/lychee#1637

This is what I got working:

.github/lychee-problem-matcher.json:

{
	"problemMatcher": [
		{
			"owner": "lychee",
			"pattern": [
				{
					"regexp": "^\\[(.*)\\]:$",
					"file": 1
				},
				{
					"regexp": "^\\s*\\[ERROR\\] (.*)$",
					"message": 1,
					"loop": true
				}
			]
		}
	]
}
      - run: echo "::add-matcher::.github/lychee-problem-matcher.json"
      - name: Link Checker
        if: ${{ steps.changed-files.outputs.all_changed_files }}
        uses: lycheeverse/[email protected]
        with:
          fail: true
          args: --root-dir $(pwd) -E -i -n -t 45 -- '${{ steps.changed-files.outputs.all_changed_files }}'
          format: compact
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          NO_COLOR: 1

Resulting in this:

Image

Image

However the line number is missing in the output, so the annotation doesn't get added to the right place in the file

@mre mre added the help wanted Extra attention is needed label Feb 18, 2025
@mre
Copy link
Member

mre commented Feb 18, 2025

Great progress! I like the output. As mentioned in the linked issue, I think we need to add support for line numbers first. Some parsers don't support that out of the box, but there are workarounds like searching through the files ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants