Merge pull request #394 from gardar/fix-docs-push-permissions

skip_changelog(ci): fix docs publish permissions
This commit is contained in:
gardar 2024-07-01 14:02:31 +00:00 committed by GitHub
commit 6662e567d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -54,11 +54,14 @@ jobs:
if: github.repository == 'prometheus-community/ansible' if: github.repository == 'prometheus-community/ansible'
permissions: permissions:
contents: write contents: write
pages: write
id-token: write
needs: [build-docs] needs: [build-docs]
name: Publish Ansible Docs name: Publish Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
with: with:
artifact-name: ${{ needs.build-docs.outputs.artifact-name }} artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
publish-gh-pages-branch: true
action: ${{ (github.event.action == 'closed' || needs.build-docs.outputs.changed != 'true') && 'teardown' || 'publish' }} action: ${{ (github.event.action == 'closed' || needs.build-docs.outputs.changed != 'true') && 'teardown' || 'publish' }}
secrets: secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -56,10 +56,13 @@ jobs:
if: github.repository == 'prometheus-community/ansible' if: github.repository == 'prometheus-community/ansible'
permissions: permissions:
contents: write contents: write
pages: write
id-token: write
needs: [build-docs] needs: [build-docs]
name: Publish Ansible Docs name: Publish Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
with: with:
artifact-name: ${{ needs.build-docs.outputs.artifact-name }} artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
publish-gh-pages-branch: true
secrets: secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}