Skip to content

Added support for version bump github action using fastlane #10

Added support for version bump github action using fastlane

Added support for version bump github action using fastlane #10

Workflow file for this run

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
git push origin $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_NEWS_FEED_V2 }}
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."