File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2121 with :
2222 fetch-depth : 0
23+ persist-credentials : false
2324
2425 # ansible-doc-extractor requires the collection to be in a directory in
2526 # the form ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/
@@ -41,10 +42,20 @@ jobs:
4142 - name : create documentation
4243 run : ansible-doc-extractor docs/ plugins/inventory/* plugins/modules/*
4344
45+ # the token is needed so the github app can push to the repository
46+ # the github app can bypass the branch protection rule (need a PR to merge)
47+ # this way it can directly commit to main
48+ - name : Obtain a GitHub App Installation Access Token
49+ id : githubAppAuth
50+ run : |
51+ TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_BRANCH_PROTECTION_APP_TOKEN }})"
52+ echo "::add-mask::$TOKEN"
53+ echo token=${TOKEN} >> $GITHUB_OUTPUT
54+
4455 - name : commit documentation
4556 uses : github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa # v2.9
4657 with :
47- github-token : ${{ secrets.GITHUB_TOKEN }}
58+ github-token : ${{ steps.githubAppAuth.outputs.token }}
4859 push-branch : ' main'
4960 commit-message : ' update documentation'
5061 force-add : ' true'
6071 - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6172 with :
6273 fetch-depth : 0
74+ persist-credentials : false
6375
6476 - name : Set up Python
6577 uses : actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
You can’t perform that action at this time.
0 commit comments