Skip to content

Commit 232edcb

Browse files
committed
run generation for seth
1 parent 8b678de commit 232edcb

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

.github/workflows/generate-go-docs.yaml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,32 +60,48 @@ jobs:
6060
PATH=$PATH:$(go env GOPATH)/bin
6161
export PATH
6262
# TODO check why this flag is needed, if it has a default!
63-
generate-go-function-docs diff -b ${{ github.event.pull_request.base.sha }} -c ${{ github.event.pull_request.head.sha }} -g fake_slash -f .
63+
# TODO we need a way to determine which modules have changes and run this command for all of them
64+
generate-go-function-docs diff -b ${{ github.event.pull_request.base.sha }} -c ${{ github.event.pull_request.head.sha }} -g fake_slash -f ./seth --goModLocation ./seth/go.mod
6465
6566
- name: Make sure code still compiles
6667
run: |
68+
# TODO we need a way to determine which modules have changes and run this command for all of them
69+
cd seth
6770
go mod tidy
6871
go build ./...
6972
70-
- name: Commit changes
71-
run: |
72-
git add .
73-
git commit -m "Add automatically generated go documentation"
74-
git push origin ${{ github.event.pull_request.head.ref }}-docs
75-
7673
- name: Setup GitHub Token for creating a new PR
7774
id: setup-github-token-write
7875
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
7976
with:
80-
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_READ_GENERATE_GO_DOC_REPO }}
77+
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_CREATE_PR }}
8178
aws-lambda-url: ${{ secrets.GATI_LAMBDA_TT_URL }}
82-
aws-region: ${{ secrets.AWS_REGION }}
79+
aws-region: ${{ secrets.AWS_REGION }}
80+
81+
82+
- name: Checkout new branch
83+
uses: peterjgrainger/action-create-branch@10c7d268152480ae859347db45dc69086cef1d9c # v3.0.0
84+
env:
85+
GITHUB_TOKEN: ${{ steps.setup-github-token-write.outputs.access-token }}
86+
with:
87+
branch: ${{ github.event.pull_request.head.ref }}-docs
88+
89+
- name: Commit changes
90+
uses: planetscale/ghcommit-action@13a844326508cdefc72235201bb0446d6d10a85f # v0.1.6
91+
with:
92+
commit_message: "[Bot] Add automatically generated go documentation"
93+
repo: ${{ github.repository }}
94+
branch: ${{ github.head_ref }}-docs
95+
# TODO we need a way to determine which modules have changes and run this command for all of them
96+
file_pattern: "seth/*"
97+
env:
98+
GITHUB_TOKEN: ${{ steps.setup-github-token-write.outputs.access-token }}
8399

84100
- name: Create a new PR targeting current PR
85101
uses: peter-evans/create-pull-request@v7
86102
with:
87-
token: ${{ secrets.GITHUB_TOKEN }}
88-
base: ${{ github.event.pull_request.head.ref }}
89-
branch: ${{ github.event.pull_request.head.ref }}-docs
103+
token: ${{ steps.setup-github-token-write.outputs.access-token }}
104+
base: ${{ github.head_ref }}
105+
branch: ${{ github.head_ref }}-docs
90106
title: "Go docs for PR#${{ github.event.pull_request.number }}"
91107
body: "This PR contains automatically generated go documentation for the PR#${{ github.event.pull_request.number }}. Please review the changes."

0 commit comments

Comments
 (0)