1
1
name : Update OCM CLI Docs
2
2
3
+ permissions :
4
+ contents : read # for checkout, file reads
5
+ actions : write # to call repository_dispatch
6
+ pull-requests : write # to create or update PRs
7
+
3
8
on :
4
9
repository_dispatch :
5
10
types : [ocm-cli-release]
@@ -20,22 +25,36 @@ jobs:
20
25
- uses : actions/checkout@v4
21
26
with :
22
27
persist-credentials : false
28
+
23
29
- name : Update Version Parameter
24
30
run : |
25
31
TAG=${{ github.event.client_payload.tag }}
26
32
sed -i "s/latest_version = .*/latest_version = \"$TAG\"/" ./config/_default/params.toml
33
+
27
34
- name : Setup Go
28
35
uses : actions/setup-go@v5
29
36
with :
30
37
go-version-file : ' ${{ github.workspace }}/go.mod'
38
+
31
39
- name : Regenerate CLI docs
32
40
run : |
33
41
go get ocm.software/ocm@${{ github.event.client_payload.tag }}
34
42
go mod tidy
35
43
go run ./hack/generate-cli-docs --output-dir=${{ env.OUTPUT_DIR }}
44
+
45
+ - name : Get OCMBot installation token
46
+ # Instead of creating the PR below with GITHUB_TOKEN use a generated
47
+ # short-lived App installation token with full REST rights
48
+ id : generate_token
49
+ uses : tibdex/github-app-token@v2
50
+ with :
51
+ app_id : ${{ secrets.OCMBOT_APP_ID }}
52
+ private_key : ${{ secrets.OCMBOT_PRIV_KEY }}
53
+
36
54
- name : Create Pull Request
37
55
uses : peter-evans/create-pull-request@v7
38
56
with :
57
+ token : ${{ steps.generate_token.outputs.token }}
39
58
title : " Update CLI docs"
40
59
commit-message : " [github-actions] automated change"
41
60
add-paths : |
49
68
sign-commits : true
50
69
body : |
51
70
Update OCM CLI documentation for new release
71
+
0 commit comments