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

Not excluding .png #1620

Open
sekyondaMeta opened this issue Jan 30, 2025 · 0 comments
Open

Not excluding .png #1620

sekyondaMeta opened this issue Jan 30, 2025 · 0 comments

Comments

@sekyondaMeta
Copy link

Running the workflow below does not seem to exclude the .png file. I have tried differernt permutations and combinations of adding the regex but nothing seems to work. Any ideas would be greatly appreciated.

Workflow:
`name: link check on PR

on:
pull_request:
branches: [main]

jobs:
linkChecker:
runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 1

  - name: Get Changed Files
    id: changed-files
    uses: tj-actions/changed-files@v41

  - name: Check for Skip Label
    id: skip-label
    uses: actions/github-script@v6
    with:
      script: |
        const labels = await github.rest.issues.listLabelsOnIssue({
          owner: context.repo.owner,
          repo: context.repo.repo,
          issue_number: context.issue.number
        });
        return labels.data.some(label => label.name === 'skip-link-check');
      
  - name: Check Links
    if: steps.skip-label.outputs.result == 'false'
    uses: lycheeverse/lychee-action@v1
    with:
      args: --exclude '\.(pdf|zip|png|jpg)$' --accept=200,403,429 --base . --verbose --no-progress ${{ steps.changed-files.outputs.all_changed_files }}
      token: ${{ secrets.CUSTOM_TOKEN }}
      fail: true
      
  - name: Skip Message
    if: steps.skip-label.outputs.result == 'true'
    run: echo "Link check was skipped due to the presence of the 'skip-link-check' label."
    
  - name: Suggestions
    if: failure()
    run: |
      echo -e "\nPlease review the links reported in the Check links step above."
      echo -e "If a link is valid but fails due to a CAPTCHA challenge, IP blocking, login requirements, etc., consider adding such links to .lycheeignore file to bypass future checks.\n"
      exit 1`

error message:

Run lycheeverse/lychee-action@v1 Run # Cleanup artifacts from previous run in case it crashed lychee Run /home/runner/work/_actions/lycheeverse/lychee-action/v1/entrypoint.sh Error: Cannot read input content from file recipes_source/customaddandround.png

Caused by: stream did not contain valid UTF-8

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

No branches or pull requests

1 participant