-
-
Notifications
You must be signed in to change notification settings - Fork 57
68 lines (62 loc) · 2.29 KB
/
plan-release.yml
File metadata and controls
68 lines (62 loc) · 2.29 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
58
59
60
61
62
63
64
65
66
67
68
name: Plan Release
on:
workflow_dispatch:
push:
branches:
- main
- master
pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
types:
- labeled
- unlabeled
concurrency:
group: plan-release # only the latest one of these should ever be running
cancel-in-progress: true
jobs:
is-this-a-release:
name: Is this a release?
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.check-release.outputs.is-release }}
steps:
- uses: kategengler/actions/release-plan/check-if-release@v0.0.7
with:
ref: 'main'
id: check-release
create-prepare-release-pr:
name: Create Prepare Release PR
runs-on: ubuntu-latest
timeout-minutes: 5
needs: is-this-a-release
permissions:
contents: write
issues: read
pull-requests: write
# only run on push event or workflow dispatch if plan wasn't updated (don't create a release plan when we're releasing)
# only run on labeled event if the PR has already been merged
if: >
needs.is-this-a-release.outputs.is-release != 'release' &&
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
)
steps:
- uses: kategengler/actions/release-plan/prepare@v0.0.7
name: Run release-plan prepare
with:
ref: 'main'
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
id: explanation
- uses: peter-evans/create-pull-request@v7
name: Create Prepare Release PR
with:
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
labels: 'internal'
branch: release-preview
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
body: |
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
-----------------------------------------
${{ steps.explanation.outputs.text }}