diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..64ce3311 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,35 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot: + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + + steps: + - name: Fetch Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Approve Dependabot PR + if: | + steps.metadata.outputs.update-type == 'version-update:semver-patch' || + steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge + if: | + steps.metadata.outputs.update-type == 'version-update:semver-patch' || + steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index db87b2a1..00401493 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -3,6 +3,7 @@ name: documentation on: push: branches: [ main ] + pull_request: workflow_dispatch: permissions: @@ -35,8 +36,12 @@ jobs: run: uv run sphinx-build docs/source _site - name: Upload Pages artifact + if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@v5 + with: + path: _site - name: Deploy to GitHub Pages id: deployment + if: github.event_name != 'pull_request' uses: actions/deploy-pages@v5