github / github/vscode-github-actions

Unable to find reusable workflow

オープン
#254 コメント 23 件 リアクション 82 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
660
フォーク
213
PR マージ指標
30日以内にマージされた PR はありません

説明

**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:
```dir
.github/workflows/
- base.yml
- reusable.yml
```
And the following workflows:
```yml
# base.yml
name: base
on:
pull_request:

permissions:
contents: read
id-token: write

jobs:
reusable:
uses: ./.github/workflows/reusable.yml
with:
EXAMPEL: example
```
```yml
# 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 }}"
```
2. Go to `base.yml` in VS Code.
3. 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](https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow), and since it does indeed execute successfully, this error should not occur.

**Screenshots**
![Screenshot 2023-09-01 at 09 39 51](https://github.com/github/vscode-github-actions/assets/11174653/860cbc0f-b501-47ea-9c87-63dbf94475f5)

**Extension Version**
`v0.26.1`

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

base.yml と .github/workflows/reusable.yml を使用して VS Code で失敗を再現し、その後 documentLink リクエストと reusable-workflow 参照の処理を調査します。ローカルパスが受け入れられ、linting エラーが消え、ドキュメントリンクが Invalid file reference エラーなしで解決されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github-actions, typescript, vscode
領域
ci-cd, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。