github / github/vscode-github-actions

The `runner.environment` context is shown as invalid in this extension.

Đang mở
#428 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
660
Fork
213
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
When we use the `runner.environment` context listed in [official document](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context), this extension reports "Context access might be invalid".

**To Reproduce**
Steps to reproduce the behavior:
1. With this workflow '...'

```yaml
steps:
- if: ${{ runner.environment == 'github-hosted' }}
run: echo "This is a ${{ runner.environment }} runner"
```

2. Do this '...'

Open the "Problems" Panel.

3. See error\

```plain
Context access might be invalid: environment
```

**Expected behavior**
The `runner.environment` context listed in [official document](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context) can be recognized well by this extension.

**Screenshots**
![image](https://github.com/user-attachments/assets/335f46d8-d511-4f91-a2dd-5c78b5c0c1e3)

**Extension Version**
`v0.27.0`

**Additional context**
Add any other context about the problem here.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện đoạn workflow được cung cấp trong extension và kiểm tra đường dẫn xác thực context tạo ra cảnh báo của Problems-panel. Công việc hoàn tất khi runner.environment được nhận diện theo tài liệu được liên kết về runner context của GitHub Actions và cảnh báo không còn xuất hiện đối với biểu thức này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.