build(deps): bump the go-mod group with 5 updates (#621) #95
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: "Sync Generated Docs" | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| env: | |
| DOCS_REPO: "authzed/docs" | |
| TARGET_DOCS_FILE: "app/spicedb/getting-started/installing-zed/page.mdx" | |
| CHANGES_DETECTED: false | |
| permissions: | |
| contents: "write" | |
| pull-requests: "write" | |
| actions: "write" | |
| repository-projects: "write" | |
| jobs: | |
| sync-docs: | |
| name: "Generate & Sync Documentation" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v6" | |
| - uses: "authzed/actions/setup-go@main" | |
| - uses: "authzed/actions/setup-mage@main" | |
| - name: "Generate Documentation" | |
| run: "mage gen:docsForPublish" | |
| - name: "Checkout docs repository" | |
| uses: "actions/checkout@v6" | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| repository: "${{ env.DOCS_REPO }}" | |
| path: "docs-repo" | |
| ref: "main" | |
| - name: "Sync documentation changes" | |
| id: "check-changes" | |
| run: | | |
| cp -v docs/merged.md docs-repo/$TARGET_DOCS_FILE | |
| if [[ -n "$(git -C docs-repo status --porcelain)" ]]; then | |
| echo "changes were made" | |
| echo "docs_changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "no changes were made" | |
| echo "docs_changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: "Create commit & pull request" | |
| if: "steps.check-changes.outputs.docs_changed == 'true'" | |
| id: "cpr" | |
| uses: "peter-evans/create-pull-request@v8" | |
| with: | |
| token: "${{ secrets.PAT_TO_PUSH_TO_DOCS }}" | |
| path: "docs-repo" | |
| title: "Auto-generated PR: Update zed docs" | |
| body: "This PR was auto-generated by GitHub Actions." | |
| branch: "docs-zed-update" | |
| branch-suffix: "random" | |
| - name: "Approve Pull Request in target" | |
| uses: "juliangruber/approve-pull-request-action@b71c44ff142895ba07fad34389f1938a4e8ee7b0" # v2.0.6 | |
| if: "steps.check-changes.outputs.docs_changed == 'true'" | |
| with: | |
| repo: "authzed/docs" | |
| github-token: "${{ secrets.AUTHZEDAPPROVER_REPO_SCOPED_TOKEN }}" | |
| number: "${{ steps.cpr.outputs.pull-request-number }}" | |
| - name: "Enable Pull Request Automerge in target" | |
| if: "steps.check-changes.outputs.docs_changed == 'true'" | |
| run: "gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --merge --auto -R ${{ env.DOCS_REPO }}" | |
| env: | |
| GH_TOKEN: "${{ secrets.AUTHZEDAPPROVER_REPO_SCOPED_TOKEN }}" | |
| - name: "Notify in Slack if failure" | |
| if: "${{ failure() }}" | |
| uses: "slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a" # v2.1.1 | |
| with: | |
| webhook: "${{ secrets.SLACK_BUILDS_WEBHOOK_URL }}" | |
| webhook-type: "incoming-webhook" | |
| payload: | | |
| text: ":x: @eng-oss Could not sync docs from zed repo to the docs repo" | |
| blocks: | |
| - type: "section" | |
| text: | |
| type: "mrkdwn" | |
| text: | | |
| :x: @eng-oss Could not sync docs from zed repo to the docs repo. Please take a look. | |
| *Repository:* <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> | |
| *Job Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> |