@@ -60,32 +60,40 @@ 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+ - name : Commit changes
82+ uses : planetscale/ghcommit-action@13a844326508cdefc72235201bb0446d6d10a85f # v0.1.6
83+ with :
84+ commit_message : " [Bot] Add automatically generated go documentation"
85+ repo : ${{ github.repository }}
86+ branch : ${{ github.head_ref }}-docs
87+ # TODO we need a way to determine which modules have changes and run this command for all of them
88+ file_pattern : " seth/*"
89+ env :
90+ GITHUB_TOKEN : ${{ steps.setup-github-token-write.outputs.access-token }}
8391
8492 - name : Create a new PR targeting current PR
8593 uses : peter-evans/create-pull-request@v7
8694 with :
87- token : ${{ secrets.GITHUB_TOKEN }}
88- base : ${{ github.event.pull_request.head.ref }}
89- branch : ${{ github.event.pull_request.head.ref }}-docs
95+ token : ${{ steps.setup-github-token-write.outputs.access-token }}
96+ base : ${{ github.head_ref }}
97+ branch : ${{ github.head_ref }}-docs
9098 title : " Go docs for PR#${{ github.event.pull_request.number }}"
9199 body : " This PR contains automatically generated go documentation for the PR#${{ github.event.pull_request.number }}. Please review the changes."
0 commit comments