Problem
When accessing array elements in event payloads using index syntax, the language service produces a false positive warning:
Context access might be invalid: 0
To Reproduce
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.event.commits[0].message }}
This shows the warning even though commits is a valid array property of the push event payload.
Expected behavior
No warning should be shown for valid array index access on known array properties.
Actual behavior
Warning: Context access might be invalid: 0
Root cause (likely)
The expression evaluator validates property access but doesn't properly handle numeric array indices. When encountering commits[0], it treats 0 as a property name lookup on the commits dictionary/array, and since there's no key named "0", it warns.
Related
This was discovered while verifying issue #97 is fixed. The original issue (#97) about github.event.head_commit.message is now working correctly, but array access remains problematic.
Package/Area