Shouldn't warn with "Context access might be invalid" if not logged in
Describe the bug This mostly shows itself when using the GitHub Actions VSCode extension, but not logging in. In this case the extension reports the warning "Context access might be invalid" on all secret names, which is presumably unwanted behavior.
Since the warning is caused by the language server, this seems like the appropriate repo to open the issue in.
To Reproduce Steps to reproduce the behavior:
- Install the GitHub Actions VSCode extension but do not log in (or log out if you're already logged in).
- Navigate to an action file using a secret.
- Observe that the warning is logged.
Expected behavior The language server either logs one warning, saying that it isn't logged in, or doesn't log any warning at all.
Screenshots
Package/Area
- [ ] Expressions
- [ ] Workflow Parser
- [x] Language Service
- [ ] Language Server
Package Version
v0.3.8
Additional context Code logging the warning appears to be:
https://github.com/actions/languageservices/blob/4280a967a8aa058dd3c8825349b90bc932d82283/languageservice/src/expression-validation/evaluator.ts#L25-L29
This has been previously reported in the github/vscode-github-actions repo, including in https://github.com/github/vscode-github-actions/issues/222#issuecomment-1714412212
This is happening to me, in vscode, in the secrets context, and I am logged in (I see the variable listed under Settings under Secrets in the GitHub Actions tree browser sidebar.
Most of the discussion seems to be in https://github.com/github/vscode-github-actions/issues/222