This repository has been archived by the owner on Dec 21, 2024. It is now read-only.
140 Create version pull request #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/apply-git-user@1.0.0 | |
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 }} |