-
Notifications
You must be signed in to change notification settings - Fork 81
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
Workflow expression variable reference checks miss some variables #61
Comments
Another instance is about Example workflow: jobs:
build-python-test:
name: Build Python for test
runs-on: ubuntu-20.04
steps:
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
job_name: Test
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }} |
@briantist Thanks for reporting this, I agree this is something we should look into. @ad-m-ss That is a valid error. The job isn't using a matrix strategy, so it won't be defined. |
This is fixed and will be included in the next release. |
It has been said it will be fixed in the next release. |
The release should've gone out by now. If you're still seeing issues, would you mind creating another issue with more details? Thanks |
When is the release? |
I don't seem to have the release here either weirdly |
duplicate of #222 |
Describe the bug
The expression checker looks to see if variables that are referenced are actually defined and warns if a context reference may not be valid. This can cause bugs like #47 , but also it's missing some variables completely.
From the above issue:
This raises the
Context access might be invalid
warning forenv.GITHUB_REF_SLUG
.If the expression itself branches like so, only the
"false"path as evaluated in the extension will raise a warning:Here, the warning will be raised again, but only for
env.GITHUB_REF_SLUG
.If we "define" the env var in an
env
block explicitly:then the warning goes away completely, and
env.FAKE_VAR
is never considered.Alternatively, if we change the expression to something that can be evaluated as
true
at parse time:Then the warning will change to
env.FAKE_VAR
only, ignoring the other one.To Reproduce
See above.
Expected behavior
Both vars are warned against.
Extension Version
v0.25.3
The text was updated successfully, but these errors were encountered: