Inconsistent allowed contexts for reusable workflow secrets/inputs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu bằng cách so sánh actions/reference/workflows-and-actions/contexts.md với actions/reference/workflows-and-actions/reusable-workflows.md, tập trung vào các mục jobs.<job_id>.secrets.<secret_id> và jobs.<job_id>.with.<input_id>. Xác định các context được phép đã được ghi trong tài liệu và thống nhất tên các khóa workflow để cả hai trang mô tả cùng một hành vi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
- https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
- https://docs.github.com/en/actions/reference/workflows-and-actions/reusable-workflows
What part(s) of the article would you like to see updated?
I have found inconsistencies between the actions/reference/workflows-and-actions/contexts.md and the actions/reference/workflows-and-actions/reusable-workflows.md pages.
The reusable-workflows.md page defines contexts for jobs.<job_id>.secrets.<secret_id> and jobs.<job_id>.with.<input_id> like so:
## `jobs.<job_id>.with.<input_id>`
[...]
Allowed expression contexts: `github`, and `needs`.
## `jobs.<job_id>.secrets.<secret_id>`
[...]
Allowed expression contexts: `github`, `needs`, and `secrets`.
This seems to match observed behavior that the following using After testing in a different and cleaner environment, this actually does not match the observed behavior, as the following using vars, using a reusable workflow that requires a secret, does not work:vars, using a reusable workflow that requires a secret, does work:
jobs:
job:
uses: job.yml
secrets:
MY_SECRET: ${{ vars.MY_SECRET }}
Indeed, the contexts.md page defines these contexts like so:
| `jobs.<job_id>.secrets.<secrets_id>` | `github, needs, strategy, matrix, secrets, inputs, vars` | None |
| `jobs.<job_id>.with.<with_id>` | `github, needs, strategy, matrix, inputs, vars` | None |
So I would have expected vars to work in this context, but it does not.
Also while we are at it, note the workflow keys are not consistent: secrets_id vs secret_id, and with_id vs input_id.
Therefore I would suggest to:
- Rename the workflow keys in the
contexts.mdpage to match those in thereusable-workflows.mdpage, - Update the "allowed expression contexts" in the
reusable-workflows.mdpage to match what is described in thecontexts.mdpage.
Additional information
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 20.9k
- Fork
- 68.8k
- Merge trung bình
- 13 giờ 43 phút
- Pull request đã merge (30 ngày)
- 110
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/docs
-
builder persona content
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
localization
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 72/100
-
builder persona
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
content localization
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
content localization
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ontola/atomic-server#1625 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
melgarafael/DeskcommCRM#1451 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
midnightntwrk/midnight-sdk#403 ·