vscode-github-actions: Unable to find reusable workflow

Describe the bug When leveraging local reusable workflows, i.e. referencing other workflows inside of the .github/workflows/ directory, the extension claims that it cannot find the reusable workflow. The reusable workflow is indeed in the right place, and it executes successfully by Github Actions.

To Reproduce Steps to reproduce the behavior:

  1. With the following directory structure:
.github/workflows/
    - base.yml
    - reusable.yml

And the following workflows:

# base.yml
name: base
on:
  pull_request:

permissions:
  contents: read
  id-token: write

jobs:
  reusable:
    uses: ./.github/workflows/reusable.yml
    with:
      EXAMPEL: example
# reusable.yml
name: reusable
on:
  workflow_call:
    inputs:
      EXAMPLE:
        description: Example.
        type: string
        required: true

permissions:
  contents: read
  id-token: write

jobs:
  reusable:
    name: Example
    runs-on: ubuntu-latest
    steps:
      - name: Example step
        run: echo "${{ inputs.EXAMPLE }}"
  1. Go to base.yml in VS Code.
  2. The linting error Unable to find reusable workflow is presented. In addition, this is the output from Github Actions Language:
[Error - 09:26:39] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: Invalid file reference: .github/workflows/reusable.yml
Code: -32603

Expected behavior As this is indeed a valid file reference according to github documentation, and since it does indeed execute successfully, this error should not occur.

Screenshots Screenshot 2023-09-01 at 09 39 51

Extension Version v0.26.1

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 41
  • Comments: 16

Most upvoted comments

Still happening on MacOS. Reloading window doesn’t help, restarting doesn’t help. Ref: https://github.com/github/vscode-github-actions/issues/68

Edit, what helped for me was to:

  • close all repositories in the Source Repositories view
  • Reopen all closed repositories
  • Reload window

I have my root folder opened - and it was happening to me… but now it solved itself, I relaunched VSCode this morning (update) and paths work fine now.

Same here.

Pinning to branch and SHA does not resolve the issue.

Also even if branch is not yet pushed, it should be able to find the file locally (as soon as the branch is published, file will be there and if reusable workflow is triggered on PR, it will be triggered and will pass).

👋 Can you try pinning the reusable workflow to a branch or SHA to see if it resolves the error?

Any news? I’m getting this too! 😃