github / github/vscode-github-actions
Problems pane shows problems from git diffs
- Dominant language
- TypeScript
- Stars
- 660
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Whenever I open up a workflow with the git diff editor, it evaluates both the file prior to the made changes and the current version.
The problems are not keyed by file name, resulting in multiple groups of problems in the problem pane.
The main problem I have is that they don't disappear even after closing the diff editor.
I have attached a screenshot of how it behaves.
**To Reproduce**
Steps to reproduce the behavior:
1. Set up a file with the name `cd.yaml` with the following contents in the `.github/workflows` folder of a project. (the important part is just being able to produce a problem within a workflow file, I'll attach a segments of mine as an example)
```yaml
name: Deployment
on:
push:
tags:
- '*'
jobs:
deploy-images:
runs-on: ubuntu-latest
steps:
- run: echo 'hello'
deploy-staging:
runs-on: ubuntu-latest
environment: Staging
needs: deploy-images
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Set up kubectl
uses: azure/setup-kubectl@v3
- name: Set k8s context
uses: azure/k8s-set-context@v3
with:
method: service-account
k8s-url: ${{ env.K8S_API_URL }}
k8s-secret: ${{ secrets.K8S_SECRET }}
```
2. Initialize a git repo and commit the file
3. Make changes to the workflow file
4. View the diff by clicking the file from the `Source Control` tab in VSCode
5. Check the problems tab
6. Close the diff tab
7. Check the problems tab again
8. Click a problem, and a read-only file will open
**Expected behavior**
I don't typically see linting tools behave in this manner, the other ones I use such as SonarLint only show problems for the current state of the file.
**Screenshots**
The problems tab after opening diff editors:

The read-only file opened when clicking the problem:

**Extension Version**
`v0.25.4`
Contributor guide
Assessment
This issue has not been assessed yet.