Skip to content

Commit

Permalink
Change the token use for Pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
XinRanZhAWS committed Mar 21, 2024
1 parent f8aecec commit 99ba41f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/pre_release_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ jobs:
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Extract Major.Minor Version and setup Env variable
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
- name: Create branches
run: |
VERSION="${{ github.event.inputs.version }}"
MAJOR_MINOR=$(echo $VERSION | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')
git checkout -b "release/${MAJOR_MINOR}.x"
git push origin "release/${MAJOR_MINOR}.x"
git checkout -b "${VERSION}_release"
git push origin "${VERSION}_release"
- name: Update version in file
run: |
sed -i 's/__version__ = ".*"/__version__ = "${{ github.event.inputs.version }}"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
git commit -am "Update version to ${{ github.event.inputs.version }}"
git push origin "${{ github.event.inputs.version }}_release"
sed -i 's/__version__ = ".*"/__version__ = "${VERSION}"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
git commit -am "Update version to ${VERSION}"
git push origin "${VERSION}_release"
# - name: Create Pull Request
# uses: repo-sync/pull-request@v2
Expand All @@ -58,12 +61,9 @@ jobs:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ github.event.inputs.version }}"
MAJOR_MINOR=$(echo $VERSION | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')
echo "Major.Minor version is ${MAJOR_MINOR}"
echo "${{ github.event.inputs.version }}_release"
gh pr create --title "Pre-release: Update version to ${VERSION}" \
--body "This PR updates the version to ${VERSION}.
gh pr create --title "Pre-release: Update version to ${{ github.event.inputs.version }}" \
--body "This PR updates the version to ${{ github.event.inputs.version }}. \n\n By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
--head ${{ github.event.inputs.version }}_release \
--base release/${MAJOR_MINOR}.x

0 comments on commit 99ba41f

Please sign in to comment.