-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.47 KB
/
release.yml
File metadata and controls
43 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Release
on:
push:
branches: [main]
workflow_dispatch: {}
# Note: release-please uses GITHUB_TOKEN, which can't trigger other workflows
# (GitHub limitation). When the release PR auto-merges, the push to main does
# NOT trigger this workflow. After the release PR merges, manually dispatch:
# gh workflow run Release
# CI checks on release PRs are handled by release-pr-checks.yml via
# workflow_run (fires when this workflow completes). That workflow posts commit
# statuses to the PR head SHA so branch protection sees the results.
# Docker publishing uses docker-publish.yml (also workflow_run).
permissions: read-all
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
pr: ${{ steps.rp.outputs.pr }}
release_created: ${{ steps.rp.outputs.release_created }}
steps:
- name: Run release-please
id: rp
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Auto-merge release PR
if: steps.rp.outputs.pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUM=$(echo '${{ steps.rp.outputs.pr }}' | jq -r '.number')
echo "Enabling auto-merge for release PR #$PR_NUM"
gh pr merge "$PR_NUM" --auto --squash --repo "${{ github.repository }}"