Skip to content
# name: Upgrade version by tag
# permissions:
# contents: write
# pull-requests: write
# on:
# push:
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
# jobs:
# upgrade_version:
# runs-on: ubuntu-latest
# env:
# TAG_VERSION: ${{ github.ref_name }}
# BRANCH_NAME: update-tag-version-${{ github.ref_name }}
# steps:
# # Step 1: Checkout the original repository's code
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# # repository: openimsdk/actions-test
# fetch-depth: 0
# # Step 2: Set up Git with official account
# - name: Set up Git
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# # # Step 3: Create a new branch for version update
# # - name: Create new branch for version update
# # run: |
# # git checkout -b ${{ env.BRANCH_NAME }}
# # Step 4: Update version file
# - name: Update version file
# run: |
# echo "${{ env.TAG_VERSION }}" > version/version
# # Step 5: Create a Pull Request from the new branch to the original repository
# - name: Create Pull Request
# id: create_pr
# uses: peter-evans/[email protected]
# with:
# branch-token: ${{ secrets.GITHUB_TOKEN }}
# token: ${{ secrets.GITHUB_TOKEN }}
# # token: ${{ secrets.BOT_TOKEN }}
# commit-message: "Update version to ${{ env.TAG_VERSION }}"
# branch: ${{ env.BRANCH_NAME }}
# delete-branch: true
# base: main
# title: "Update version to ${{ env.TAG_VERSION }}"
# body: "This PR updates the version file to the new tag version ${{ env.TAG_VERSION }}."