feat: Expose gitops-pusher result as step outputs (e.g. for PR comments)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
调研方向
Start in action.yml, especially the Gitops pusher step and the action's existing outputs and execution flow. Exercise the action: test path with a successful and failing policy check, then verify the declared outcome, output, and changed values are available to later steps while failures still produce a non-zero status.
由索引模型根据 Issue 内容生成。
描述
Summary
Expose the result of gitops-pusher as step outputs so a later step in the workflow can report it, for example by posting a comment on the pull request.
Motivation
When action: test runs on a pull request, the only place to see why it failed is the job log. For example:
test(s) failed
For user tag:example:
Errors found:
- [acl test error]: address "tag:server:22" (protocol "tcp"): want: Drop, got: Accept
exit status 1
It would be much easier to review policy changes if that message could be posted to the PR automatically. Right now the action gives a later step nothing to work with:
- It defines no
outputs, so later steps can't read the result or the error text. - The output from
gitops-pusheronly goes to the job log.
To get a PR comment today, I had to stop using the action for PR checks and copy what it does into my own workflow: set up Go, pin the same gitops-pusher commit, run it with | tee, and fetch the live policy from the API myself. I'd rather keep using the action and keep getting its updates.
Proposed change
Add outputs to the action, for example:
| Output | Description |
|---|---|
outcome |
success or failure from gitops-pusher |
output |
Everything gitops-pusher printed (stdout and stderr), or at least the error part |
changed |
true if the local policy differs from the live policy (control vs. local ETag) |
A diff between the live policy and the local file would also be helpful as an output, so reviewers can see exactly what merging will change. If that doesn't fit this action, the three outputs above cover the main need.
With these outputs, a workflow could do this:
- name: Test ACL
id: test-acl
uses: tailscale/gitops-acl-action@v1
continue-on-error: true
with:
oauth-client-id: ${{ secrets.TS_OAUTH_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tailnet: ${{ secrets.TS_TAILNET }}
action: test
- name: Comment on PR
if: always() && github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
OUTCOME: ${{ steps.test-acl.outputs.outcome }}
OUTPUT: ${{ steps.test-acl.outputs.output }}
run: |
# build a comment from $OUTCOME / $OUTPUT and post it with `gh pr comment`
Implementation notes
Changes to the Gitops pusher step in action.yml:
- Run
gitops-pusherwith2>&1 | teeso its output still appears in the log. - Keep its exit code, then write the output to
$GITHUB_OUTPUTusing the multiline heredoc syntax. - Declare the new values under
outputs:inaction.yml.
The step should still exit non-zero when gitops-pusher fails, so existing workflows behave the same.
Optionally, the action could write the same output to $GITHUB_STEP_SUMMARY. That would show failures on the run summary page with no extra workflow setup.
- 主要语言
- 没有语言数据
- 星标
- 153
- 派生
- 44
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tailscale/gitops-acl-action 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
tailscale/gitops-acl-action#81 · 1 条评论 ·
-
Add Workload Identity Federation Example可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
tailscale/gitops-acl-action#62 · 4 条评论 · 5 个 reaction ·
-
README.md recommends an insecure default configuration可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
tailscale/gitops-acl-action#32 · 4 条评论 · 6 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 1/5 1 小时以内 新手友好度 30/100
查看 tailscale/gitops-acl-action 的全部 Issue
相似的 Issue
-
who:julian
难度 2/5 1-3 小时 新手友好度 70/100
julian-heidt/jellyfin-media-stack#24 · 1 条评论 ·
-
area/ci
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
area:build bug effort:low P5 source:agent
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
enhancement forward/review service/compute-interconnect
难度 2/5 1-3 小时 新手友好度 75/100
hashicorp/terraform-provider-google#30702 ·
维护者通常 1 天内回复
-
external
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复