From 7cafb73d798c1b8c6199b2d66d3e89d3744e201f Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Sat, 17 Feb 2024 09:45:06 +0700 Subject: [PATCH] update. --- .github/workflows/release.yaml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3d5506b66f..f3a9ae5093 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,39 +4,35 @@ on: release: types: [published] -permissions: - contents: write - jobs: update-version: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Update version in setup.cfg - run: | - NEW_VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//') - sed -i "s/^version = .*/version = $NEW_VERSION/" setup.cfg - - name: Create New Branch + - name: Configure Git run: | git config --global user.email "action@github.com" git config --global user.name "GitHub Action" + + - name: Create New Branch and Update version in setup.cfg + run: | + NEW_VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//') NEW_BRANCH="release-${{ github.event.release.tag_name }}" + echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV # Set NEW_BRANCH for the job git checkout -b $NEW_BRANCH + sed -i "s/^version = .*/version = $NEW_VERSION/" setup.cfg git add setup.cfg git commit -m "Release EEST `${{ github.event.release.tag_name }}`" git push origin $NEW_BRANCH - name: Create Pull Request uses: peter-evans/create-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Ensure you're passing the GITHUB_TOKEN with: - branch: ${{ env.NEW_BRANCH }} + branch: ${{ env.NEW_BRANCH }} # Use the NEW_BRANCH environment variable commit-message: "Release EEST `${{ github.event.release.tag_name }}`" title: "feat(docs|fw): release EEST `${{ github.event.release.tag_name }}`" body: "This PR updates the framework version in setup.cfg to `${{ github.event.release.tag_name }}`." base: main - -