ci: run Dependabot auto-merge as a plain job
Forgejo resolves reusable workflows before job conditions, so the GitHub-only reusable workflow failed every Forgejo PR. The steps now run inline and the dependabot condition skips the job elsewhere.
- commit
- 5bd5e9f82a43f5fd4c0146022cab5cc4af27058b
- author
- brice · · 2026-10-15 02:26 UTC
- parent
- 51e0a11
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +20 -6
M .github/workflows/dependabot-auto-merge.yml +20 -6
| @@ -2,11 +2,25 @@ name: Dependabot Auto-Merge | |||
| 2 | 2 | ||
| 3 | 3 | on: pull_request | |
| 4 | 4 | ||
| 5 | + | permissions: | |
| 6 | + | contents: write | |
| 7 | + | pull-requests: write | |
| 8 | + | ||
| 5 | 9 | jobs: | |
| 10 | + | # Dependabot runs on GitHub only. A plain job (no reusable workflow) lets | |
| 11 | + | # the `if` skip it on Forgejo, which cannot resolve GitHub-only workflows. | |
| 6 | 12 | auto-merge: | |
| 7 | - | # Dependabot runs on GitHub only; the reusable workflow is not on Forgejo. | |
| 8 | - | if: github.server_url == 'https://github.com' && github.event.pull_request.user.login == 'dependabot[bot]' | |
| 9 | - | permissions: | |
| 10 | - | contents: write | |
| 11 | - | pull-requests: write | |
| 12 | - | uses: bnema/gh-actions/.github/workflows/dependabot-auto-merge.yml@main | |
| 13 | + | runs-on: ubuntu-latest | |
| 14 | + | if: github.actor == 'dependabot[bot]' | |
| 15 | + | steps: | |
| 16 | + | - name: Dependabot metadata | |
| 17 | + | id: metadata | |
| 18 | + | uses: dependabot/fetch-metadata@v3 | |
| 19 | + | with: | |
| 20 | + | github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| 21 | + | - name: Auto-merge patch and minor updates | |
| 22 | + | if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | |
| 23 | + | run: gh pr merge --auto --squash "$PR_URL" | |
| 24 | + | env: | |
| 25 | + | PR_URL: ${{ github.event.pull_request.html_url }} | |
| 26 | + | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| @@ -2,11 +2,25 @@ name: Dependabot Auto-Merge | |||||
| 2 | 2 | ||||
| 3 | on: pull_request | 3 | on: pull_request | ||
| 4 | 4 | ||||
| 5 | + | permissions: | |||
| 6 | + | contents: write | |||
| 7 | + | pull-requests: write | |||
| 8 | + | ||||
| 5 | jobs: | 9 | jobs: | ||
| 10 | + | # Dependabot runs on GitHub only. A plain job (no reusable workflow) lets | |||
| 11 | + | # the `if` skip it on Forgejo, which cannot resolve GitHub-only workflows. | |||
| 6 | auto-merge: | 12 | auto-merge: | ||
| 7 | - | # Dependabot runs on GitHub only; the reusable workflow is not on Forgejo. | 13 | + | runs-on: ubuntu-latest |
| 8 | - | if: github.server_url == 'https://github.com' && github.event.pull_request.user.login == 'dependabot[bot]' | 14 | + | if: github.actor == 'dependabot[bot]' |
| 9 | - | permissions: | 15 | + | steps: |
| 10 | - | contents: write | 16 | + | - name: Dependabot metadata |
| 11 | - | pull-requests: write | 17 | + | id: metadata |
| 12 | - | uses: bnema/gh-actions/.github/workflows/dependabot-auto-merge.yml@main | 18 | + | uses: dependabot/fetch-metadata@v3 |
| 19 | + | with: | |||
| 20 | + | github-token: "${{ secrets.GITHUB_TOKEN }}" | |||
| 21 | + | - name: Auto-merge patch and minor updates | |||
| 22 | + | if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | |||
| 23 | + | run: gh pr merge --auto --squash "$PR_URL" | |||
| 24 | + | env: | |||
| 25 | + | PR_URL: ${{ github.event.pull_request.html_url }} | |||
| 26 | + | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||