-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.68 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
50
51
52
53
54
55
56
57
58
name: Bump Version and Create PR
on:
push:
branches: [ fastlane-updated-task ]
pull_request:
branches: [ fastlane-updated-task ]
workflow_dispatch:
inputs:
bump_type:
description: 'Version Bump Type (patch/minor/major)'
required: true
default: 'patch'
jobs:
version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: fastlane-updated-task
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
- name: Install Fastlane
run: gem install fastlane
- name: Create new branch for version bump
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
new_branch="version-bump-${{ github.run_id }}"
git checkout -b $new_branch
- name: Run Fastlane lane for version bump
env:
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
run: fastlane android version_bump type:${{ github.event.inputs.bump_type }}
- name: Get the latest commit message
id: latest-commit
run: |
commit_message=$(git log -1 --pretty=%B)
echo "commit_message=$commit_message" >> $GITHUB_ENV
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.ACTION_GITHUB_TOKEN }}
source_branch: "version-bump-${{ github.run_id }}"
destination_branch: "main"
pr_title: "${{ env.commit_message }}"
pr_body: "This PR is auto-generated by GitHub Actions to bump the version."