Skip to content

Commit

Permalink
u1
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Sep 12, 2024
1 parent 04ffc4c commit 0f2d261
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/upgrade-version-by-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,31 +94,37 @@ jobs:
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 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
# Step 4: Update version file
- name: Update version file
run: |
echo "${{ env.TAG_VERSION }}" > version/version
git add version/version
git commit -m "Update version to ${{ env.TAG_VERSION }}"
# Step 5: Push the new branch to the repository
- name: Push to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用 GITHUB_TOKEN 进行身份验证
run: |
git push origin ${{ env.BRANCH_NAME }}
# # Step 4: Update version file
# - name: Update version file
# run: |
# echo "${{ env.TAG_VERSION }}" > version/version
# git add version/version
# git commit -m "Update version to ${{ env.TAG_VERSION }}"

# # Step 5: Push the new branch to the repository
# - name: Push to repository
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用 GITHUB_TOKEN 进行身份验证
# run: |
# git push origin ${{ env.BRANCH_NAME }}

# Step 6: 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:
# token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.BOT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
# token: ${{ secrets.BOT_TOKEN }}
commit-message: "Update version to ${{ env.TAG_VERSION }}"
branch: ${{ env.BRANCH_NAME }}
base: main # 原始仓库的目标分支
Expand Down

0 comments on commit 0f2d261

Please sign in to comment.