-
-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (52 loc) · 2.17 KB
/
Copy pathrelease-prepare.yml
File metadata and controls
57 lines (52 loc) · 2.17 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Caller stub: release preparation (stage 1). Worked example for podnotes (npm).
# Copy to .github/workflows/release-prepare.yml and edit the per-repo values.
#
# The workflow_run trigger cannot live in the reusable workflow, so it lives
# here. The single job forwards the tested commit (or a manually dispatched SHA)
# to the reusable prepare workflow, which re-confirms the SHA is still the
# default-branch head and opens/refreshes the standing release PR.
#
# Escape hatch: workflow_dispatch lets you plan manually (e.g. a dry-run smoke
# test before your first release) without waiting for a CI completion.
name: Prepare release
on:
workflow_run:
# Must match the name: of your CI workflow (podnotes' CI workflow is "Test").
workflows: ["Test"]
types: [completed]
workflow_dispatch:
inputs:
targetSha:
description: "Commit SHA to plan from (defaults to the default-branch head)"
required: false
type: string
permissions: {}
concurrency:
group: release-prepare
cancel-in-progress: false
jobs:
prepare:
# Manual dispatch always runs; the automatic path only runs for a green
# CI run from a push to the default branch.
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'master')
permissions:
contents: write
pull-requests: write
uses: chhoumann/obsidian-plugin-workflows/.github/workflows/release-prepare.yml@ebcf84b80dc48ba15e0eec1f3575d41519a78ed5 # v4
with:
plugin-name: podnotes
package-manager: npm
# Pin the commit-to-release policy so a toolkit update can never change it.
release-policy: '[{"scope":"deps","type":"build","release":"patch"}]'
default-branch: master
node-version: "22"
target-sha: ${{ github.event.workflow_run.head_sha || inputs.targetSha }}
release-bot-app-slug: podnotes-release-bot
app-id: ${{ vars.RELEASE_APP_ID }}
# dry-run: true # plan only; skip opening the PR (smoke test)
secrets:
release-app-private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}