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:
- 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 }}"
- Go to
base.ymlin VS Code. - The linting error
Unable to find reusable workflowis presented. In addition, this is the output fromGithub 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
Extension Version
v0.26.1
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 65
- Comments: 21
+1
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:
Reopen all closed repositoriesIt got solved when you close and open your vs code editor
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.
Restarting my VSCode many times did not help, however ReLOADING the window did with the command palette “Developer: Reload Window”.
Confirmed by changing the name of a valid file to missing (I get the red line) then changing it back the error goes away.
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?