Skip to content

Commit 62d1340

Browse files
docs(trigger-argo-workflow): specify required permissions for using w… (#967)
* docs(trigger-argo-workflow): specify required permissions for using workflow * pin trigger-argo-workflow in readme example Co-authored-by: Ricky Whitaker <[email protected]> --------- Co-authored-by: Ricky Whitaker <[email protected]>
1 parent 677accc commit 62d1340

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

actions/trigger-argo-workflow/README.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,49 @@ parameters: |
3636

3737
- `uri`: The URI of the workflow that was created.
3838

39+
## Required permissions
40+
41+
This action needs a couple of explicit `GITHUB_TOKEN` scopes because it:
42+
43+
- authenticates to Vault via GitHub OIDC (needs **`id-token: write`**)
44+
- checks out / reads Go files from the repo (needs **`contents: read`**)
45+
46+
Ideally, place these permissions at the job level to avoid zizmor flagging them as [excessive permissions](https://woodruffw.github.io/zizmor/audits/#excessive-permissions).
47+
48+
```yaml
49+
permissions:
50+
contents: read # allows actions/checkout and setup-go to read the repo
51+
id-token: write # allows get-vault-secrets to create an OIDC token for Vault
52+
```
53+
3954
## Usage
4055

4156
Here is an example of how to use this action:
4257

4358
<!-- x-release-please-start-version -->
4459

4560
```yaml
46-
steps:
47-
- name: Trigger Argo Workflow
48-
uses: grafana/shared-workflows/actions/[email protected]
49-
with:
50-
instance: "ops"
51-
namespace: "mynamespace"
52-
workflow_template: "hello"
53-
parameters: |
54-
message=world
55-
extra_args: "--generate-name hello-world-"
56-
log_level: "debug"
61+
name: Trigger Argo Workflow
62+
on:
63+
pull_request:
64+
65+
jobs:
66+
trigger-argo-workflow:
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: read
70+
id-token: write
71+
steps:
72+
- name: Trigger Argo Workflow
73+
uses: grafana/shared-workflows/actions/trigger-argo-workflow@0f705663f602e305aa22034489f351dc7022d8ce # trigger-argo-workflow-v1.1.0
74+
with:
75+
instance: "ops"
76+
namespace: "mynamespace"
77+
workflow_template: "hello"
78+
parameters: |
79+
message=world
80+
extra_args: "--generate-name hello-world-"
81+
log_level: "debug"
5782
```
5883

5984
<!-- x-release-please-end-version -->

0 commit comments

Comments
 (0)