-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the token use for Pull requests
- Loading branch information
1 parent
f8aecec
commit 99ba41f
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |