chore(deps): bump golang from 2611181 to ac09a5f in the docker gr…
#68
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: "Update Docs Repo" | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| env: | |
| DOCS_REPO: "authzed/docs" | |
| TARGET_DOCS_FILE: "app/spicedb/concepts/commands/page.mdx" | |
| permissions: | |
| contents: "write" | |
| pull-requests: "write" | |
| actions: "write" | |
| repository-projects: "write" | |
| jobs: | |
| sync-docs: | |
| name: "Generate & Sync Documentation" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Checkout source" | |
| uses: "actions/checkout@v6" | |
| - name: "Checkout target" | |
| uses: "actions/checkout@v6" | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| repository: "${{ env.DOCS_REPO }}" | |
| path: "docs-repo" | |
| ref: "main" | |
| - name: "Send changes from source to target and check if target changed " | |
| id: "check-changes" | |
| run: | | |
| set -e # Have script exit in the event of a failed command. | |
| cp -v docs/spicedb.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 in target" | |
| if: "steps.check-changes.outputs.docs_changed == 'true'" | |
| id: "cpr" | |
| uses: "peter-evans/create-pull-request@v8" | |
| with: | |
| token: "${{ secrets.AUTHZEDBOT_REPO_SCOPED_TOKEN }}" # needs permission to push to authzed/docs | |
| path: "docs-repo" | |
| title: "Auto-generated PR: Update spicedb docs" | |
| body: "This PR was auto-generated by GitHub Actions." | |
| branch: "docs-spicedb-update" | |
| commit-message: "automatic update of reference docs for spicedb" | |
| # SpiceDB uses a merge queue, which changes the commit author to the merge queue bot, and we don't want that | |
| # because the CLA check breaks | |
| author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
| committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
| - 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 spicedb repo to the docs repo" | |
| blocks: | |
| - type: "section" | |
| text: | |
| type: "mrkdwn" | |
| text: | | |
| :x: @eng-oss Could not sync docs from spicedb 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 }}> |