actions / languageservices

Language services for GitHub Actions workflows and expressions.
MIT License
74 stars 25 forks source link

Shouldn't warn with "Context access might be invalid" if not logged in #60

Open birjj opened 1 year ago

birjj commented 1 year ago

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:

  1. Install the GitHub Actions VSCode extension but do not log in (or log out if you're already logged in).
  2. Navigate to an action file using a secret.
  3. 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 Screenshot of the warning

Package/Area

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