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

Codespell renders github variables as path, rendering it useless in actions with excluded_files option #83

Open
Int-Circuit opened this issue Jan 17, 2025 · 0 comments

Comments

@Int-Circuit
Copy link

Description of the bug

When using variables to specify path of excluded_files, the action renders variables as path which fails the step

Expected behaviour

The action correctly processes the variable and uses the correct path

Logs

Input File

name: Deploy Sphinx documentation to Pages

on:
  push:
  pull_request:
    branches: [master] # branch to trigger deployment

jobs:
  pages:
    runs-on: ubuntu-20.04
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    permissions:
      pages: write
      id-token: write
    steps:
    - id: spell
      uses: codespell-project/actions-codespell@v2
      with:
        exclude_file: ${{ github.workspace }}/source/conf.py
        ignore_words_list: seealso
    - id: deployment
      uses: sphinx-notes/pages@v3
      with:
        documentation_path: ./source
        requirements_path: requirements.txt
        cache: true

Output of the action


Run codespell-project/actions-codespell@v2
/usr/bin/docker run --name c168528a75108dcb4e98bc388802de4095f1_b02b9e --label 44c168 --workdir /github/workspace --rm -e "INPUT_EXCLUDE_FILE" -e "INPUT_IGNORE_WORDS_LIST" -e "INPUT_CHECK_FILENAMES" -e "INPUT_CHECK_HIDDEN" -e "INPUT_SKIP" -e "INPUT_BUILTIN" -e "INPUT_IGNORE_WORDS_FILE" -e "INPUT_URI_IGNORE_WORDS_LIST" -e "INPUT_PATH" -e "INPUT_ONLY_WARN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/qelectrotech-doc/qelectrotech-doc":"/github/workspace" 44c168:528a75108dcb4e98bc388802de4095f1
Running codespell on '' with the following options...
Check filenames? ''
Check hidden? ''
Exclude file '/github/workspace/source/conf.py'
Skipping './.git'
Builtin dictionaries ''
Ignore words file ''
Ignore words list 'seealso'
Ignore URI words list ''
Resulting CLI options  --exclude-file /github/workspace/source/conf.py --skip ./.git --ignore-words-list seealso
Traceback (most recent call last):
  File "/usr/local/bin/codespell", line 8, in <module>
    sys.exit(_script_main())
  File "/usr/local/lib/python3.8/site-packages/codespell_lib/_codespell.py", line 1121, in _script_main
    return main(*sys.argv[1:])
  File "/usr/local/lib/python3.8/site-packages/codespell_lib/_codespell.py", line 1266, in main
    build_exclude_hashes(exclude_file, exclude_lines)
  File "/usr/local/lib/python3.8/site-packages/codespell_lib/_codespell.py", line 693, in build_exclude_hashes
    with open(filename, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/github/workspace/source/conf.py'
Codespell found one or more problems
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