feat: Add `trigger-remote-workflow` action
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với các phần Inputs, Auto-populated Payload và Example Usage, sau đó xem xét các yêu cầu của GitHub API để gửi một sự kiện repository_dispatch. Triển khai action có thể tái sử dụng dựa trên các inputs được chỉ định, các giá trị mặc định của context, việc xác thực repository và xử lý lỗi; được xem là hoàn thành khi action có thể kích hoạt workflow đích đã được ghi trong tài liệu với payload mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Create a reusable GitHub Action that dispatches a repository_dispatch event to a target repository with auto-populated context from the source workflow.
Use Case
Enable source repositories (e.g., arustydev/ai, arustydev/just) to trigger workflows in a target repository (e.g., arustydev/docs) when their documentation changes. The action automatically populates payload context from GitHub environment variables.
Specification
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
target_repo |
Yes | — | Repository to trigger (owner/repo) |
event_type |
Yes | — | Event type for repository_dispatch |
token |
Yes | — | PAT with repo scope for target |
source_repo |
No | ${{ github.repository }} |
Source repository |
ref |
No | ${{ github.ref_name }} |
Branch/tag that triggered |
sha |
No | ${{ github.sha }} |
Commit SHA |
path |
No | — | Relevant path (for filtering) |
Auto-populated Payload
{
"source_repo": "arustydev/ai",
"ref": "main",
"sha": "abc1234...",
"path": "docs/src"
}
Example Usage
- uses: arustydev/gha/trigger-remote-workflow@v1
with:
target_repo: arustydev/docs
event_type: docs-update
token: ${{ secrets.DISPATCH_TOKEN }}
path: docs/src
Implementation Notes
- Use GitHub API to send
repository_dispatchevent - Auto-detect context from
github.*environment variables when inputs not provided - Validate target_repo format (owner/repo)
- Handle API errors gracefully with clear error messages
Related
- Part of docs aggregation workflow extraction from justfile to GHA
- Works with
sparse-checkout-aggregateaction in target repo
- Ngôn ngữ chính
- Shell
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 aRustyDev/gh
-
dependencies github-actions
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
-
dependencies github-actions
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
-
dependencies github-actions
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 50/100
-
dependencies github-actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
-
dependencies github-actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 10/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
astral-sh/python-build-standalone#1293 ·
-
package-update
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
oSoWoSo/vOid_Community_repOsitory#185 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
carbon-language/carbon-lang#7821 ·