Skip to content
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

runner property "environment" is not defined in object type #412

Closed
acalcutt opened this issue Apr 15, 2024 · 3 comments
Closed

runner property "environment" is not defined in object type #412

acalcutt opened this issue Apr 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@acalcutt
Copy link

I am trying to use runner.environment in my workflow, which works. However actionlint gives me the following error

.github/workflows/node-ci.yml:168:13: property "environment" is not defined in object type {arch: string; debug: string; name: string; os: string; temp: string; tool_cache: string} [expression]
    |
168 |         if: runner.environment == 'github-hosted'

Researching the reason why I notice running.environment has not yet been documented.
https://github.com/orgs/community/discussions/118413
github/docs#32443
so I am wondering if that is related

@rhysd
Copy link
Owner

rhysd commented Apr 16, 2024

That's because it is undocumented. Once we understand it is a part of public API, we can easily add it to actionlint.

Previously there were several private context properties and such properties were removed silently. So undocumented properties are basically not recognized by actionlint.

https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context

@rhysd
Copy link
Owner

rhysd commented Apr 16, 2024

According to github/docs#32443, it seems a public API. So I will add the property.

@acalcutt
Copy link
Author

Thanks for including this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants