Added support for version bump github action using fastlane #11
Workflow file for this run
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: 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 -u ${{ secrets.ACTION_NEWS_FEED_V2 }} | |
- 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." |