This repository has been archived by the owner on Dec 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 2.06 KB
/
140-create-version-pr.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: 140 Create version pull request
on:
workflow_dispatch:
inputs:
versionMajor:
description: 'バージョン情報: major'
required: true
type: string
versionMinor:
description: 'バージョン情報: minor'
required: true
type: string
versionPatch:
description: 'バージョン情報: patch'
required: true
type: string
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
create-version-pr:
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-java-runtime
- name: Update version
id: version
run: |
jshell -R-Dargs="${{ inputs.versionMajor }} ${{ inputs.versionMinor }} ${{ inputs.versionPatch }}" .github/scripts/set-version/set-version.jsh
echo "$(jshell .github/scripts/get-version-name/get-version-name.jsh)" > TMP_LOG
bash .github/scripts/can-release.bash $(cat TMP_LOG)
echo "branch-name=feature/update_$(cat TMP_LOG)" >> "$GITHUB_OUTPUT"
echo "message=アプリバージョン更新: $(cat TMP_LOG)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- uses: tshion/[email protected]
with:
user: github-actions
- name: Git push
run: |
git switch --create ${{ steps.version.outputs.branch-name }}
git add build.properties
git commit --message "${{ steps.version.outputs.message }}"
git push --set-upstream origin ${{ steps.version.outputs.branch-name }}
- name: Create pull request
run: |
gh pr create --base ${{ github.ref_name }} --title "${{ steps.version.outputs.message }}" --body "## 確認事項
* [ ] 意図したバージョンが設定されている
* [ ] ビルド出来る"
env:
GH_TOKEN: ${{ github.token }}