-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Context access might be invalid" warning thrown for repository variables and secrets #222
Comments
Any update on this? |
I still see this as well; the extension version is v0.25.8 |
Seeing the same here constantly with |
Just wanted to confirm that the issue continues to persist in 0.25.8 (and it's feeling really annoying) |
also seeing this constantly in |
Same here. A bit annoying indeed 👍 |
Still persists kind of embarrassing for GH |
ah, i see this is an actual issue. i was going mad with this. Let´s hope it´s fixed soon. |
Yep, its a bug. Moved to triage. No ETA on a fix, if someone makes a PR to fix, I'm happy to review it. |
I uninstalled, reinstalled and restarted VSCode and then the warnings went away. |
I was receiving this error after installing the extension. Simply running the "Developer: Reload Window" command fixed it for me without needing to reinstall. So far it hasn't seemed to return yet, at least for repo secrets. |
I tried this but it came back :( |
Okay, at least in my instance, the issue seems to be because I have a setup like this: organization/repo - Main repository. Secrets/vars are done on this. myuser/repo - Fork which I do my work on before creating a merge to push to upstream/main. Therefore in actions, its thinks the vars/secrets don't exist because they existing the main repo not my fork. There should at least be a way of ignoring this specific error if this is the case. |
👋 Reporting in, still happening on
Agreed, there should at least be a |
I get this warning for any environment variable exported in a previous step via v0.26.1 |
This worked for me. |
I actually like this warning. Because our YAML file has no access to production environment variables when we're editing it, it's a nice reminder to double-check our variable names. |
That's one way of looking at it. I would say a more realistic view is that it will condition you to ignore the warnings which causes the opposite effect of what you described. |
I'm seeing this same behavior when pulling an output from a previous step through |
I had this error on |
Relogging into Actions and reloading window fixed the warning for me too! |
Joining the club asking about this - I've got dynamic environment variables and VS Code extension won't shut up about me referencing them |
I can also confirm this happens when you specify the jobs context environment property dynamically. It's not able to properly track that a variable exists. This is specific to "variables" my "secrets" seem to be tracked correctly. |
We do have all variables "in our GitHub account", still getting VS Code warnings. |
This is my experience: After opened .yml file for the first time, VS Code Askme to install the Github Action Extension, i get access to my secrets and variables in the lateral panel but in config i get the same warn message, but i restarted the VS Code Programm and the warn message dissapeared |
This worked for me after carefully adding GitHub Secrets, pushing/pulling my repo, and then pressing Ctrl + Shift + P and selecting "Developer: Reload Window. |
I want to use the language server for GHA without having the sidebar enabled but apparently that is required in order to access the secrets. I would rather have an option to disable messages like this as they are distracting and incorrect. They should appear only when the extension can access secrets and fails to find them, not when it does not have access to them. |
If you installed the GitHub Actions extension, all you have to do is perform a Developer reload in VS code 'Developer: Reload Window' and the error should go away. |
Restarting the VSCode Window doesn't seem to be working here. |
In a devcontainer, the only way for me was to disable the extension, click reload and then enable it again. |
This did it for me. Thank you @jivea! |
Restarting worked for me. |
This worked for me! |
Use-enterprise worked for a while until it stopped working. Downgrading to Something changed between The error I see when moving from |
Here is my workaround, I switched from SSH to HTTPS and the warning disappeared. I hope this helps. |
While I can fully understand why this feature was implemented there is a significant number of power-users of GHA which might use advances workflows, where the static analysis fails. I have another job that is producing the entire matrix for for running the matrix tests jobs, and I am using its output. Here is how is used: outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }} # noqa: unknown-context
# triggers ^ "Context access might be invalid: matrix" The only way to avoid is is to have some kind of magic noqa comments to silence it, like the comment that I added in the snippet. Looking at https://github.com/github/vscode-github-actions/graphs/contributors I realise that this extension is not really under any kinda of active maintenance. In fact the last change that worth being mentioned in the release notes was in may 2023 :) Still, I hope that @thyeggman might find some time to help here, even it would be with a comment that just suggests how this could be addressed (code reference, prefered way to deal with it in code). |
@boonyarit-iamsaard thanks for the suggestion but I run into the same problem using HTTPS as I do for SSH auth. @ssbarnea I don't understand why they are still upgrading it at this point, as recently as 2 months ago. They broke it in |
Environment: I am using a mixed environment - Github Enterprise for our codebase and Github for external resources. When I select Use-Enterprise, external resources are shown to be unavailable and when I deselect this option, internal resources are unavailable In the first screenshot, it shows invalid token warnings - A simple developer reload window + sign back into Github is enough to resolve these, but the Sonar action from github.com cannot be found In the second screenshot, the secrets seem to be detected correctly (despite being in the Enterprise repo), but the action located in the enterprise git cannot be found (even though I am authenticated to both enterprise and public githubs, action resolution appears to be linked to the Use-Enterprise toggle, while secrets resolution seems to always work - albeit with some bugs) |
Not working |
This worked for me |
I have two actions for test and production branches. What helped me:
|
Still an issue almost 2 year later what is the github team doing |
This issue is also triggered by using a supported feature in which one passes an environment variable as the environment name for a reusable job eg:
This causes all references to environment variables to display the warning message, even if they have been properly defined in their respective environments. |
This is completely unable to handle dynamic output parameters, such as the ones from |
Serving the board of directors who serve the investors who staked all their money on AI |
Describe the bug
After upgrading to 0.25.8, a "Context access might be invalid" warning is thrown for all repository variables and secrets in the workflow file. Refreshing the secrets/vars in the extension has no effect.
Expected behavior
Secrets/vars should not throw a "Context access might be invalid" warning.
Screenshots
Extension Version
v0.25.8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: