-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (43 loc) · 1.59 KB
/
bump-version.yml
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
name: Bump the step version
on:
workflow_dispatch:
inputs:
version:
description: "a version"
required: true
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # for now...
- id: version
run: echo "result=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
- id: current-version
run: echo "result=$(.ci/get-version)" >> $GITHUB_OUTPUT
- id: branch
name: create a branch
run: |
readonly branch_name='bump/${{ steps.version.outputs.result }}'
git switch -c "$branch_name"
echo "result=$branch_name" >> $GITHUB_OUTPUT
- run: .ci/reflect-version '${{ steps.version.outputs.result }}'
- name: commit and create a pull request
run: |
git config user.email '[email protected]'
git config user.name 'deploygate-github-actions'
git add .
git commit -m ":tada: bump up to ${{ steps.version.outputs.result }}"
git push origin '${{ steps.branch.outputs.result }}'
- name: create a pull request
run: |
readonly pr_body="$(mktemp)"
.ci/evaluate-pr-body-template ${{ steps.current-version.outputs.result }} ${{ steps.branch.outputs.result }} | tee "$pr_body"
gh pr create \
--base master \
--title "Bump up to ${{ steps.version.outputs.result }}" \
--body-file "$pr_body" \
--reviewer '${{ github.actor }}'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}