Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Update run on Push #1016

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/version-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update package version for release & hotfix branches

on:
create:
push:
branches: [release/*, hotfix/*]

permissions:
Expand Down Expand Up @@ -29,13 +29,21 @@ jobs:
echo ::set-output name=version::${PACKAGE_VERSION}
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
npm version ${PACKAGE_VERSION}
if npm version ${PACKAGE_VERSION} | tee >( grep -q 'npm ERR! Version not changed' )
then
echo "Package version is already in sync with branch name."
echo ::set-output name=should_create_pr::0
exit 0
fi
echo ::set-output name=should_create_pr::1
git push -u origin HEAD:"dev/update-version-${PACKAGE_VERSION}"
else
echo "Branch name ${BRANCH_NAME} does not have the correct format with package version."
exit 1
fi
- uses: repo-sync/pull-request@v2
- name: create version update pr
if: steps.vars.outputs.should_create_pr == 1
uses: repo-sync/pull-request@v2
with:
source_branch: "dev/update-version-${{ steps.vars.outputs.version }}"
destination_branch: "${{ steps.vars.outputs.branch }}"
Expand Down