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

Fix incorrect evaluation whether PR is prerelease #244

Merged
merged 1 commit into from
Dec 21, 2020
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
9 changes: 3 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:

if [[ "${{ github.event_name }}" == "pull_request" ]]
then
echo "PR Labels: ${{ toJson(github.event.pull_request.labels.*.name) }}"

REPO_HEAD="${{ github.event.pull_request.head.repo.full_name }}" # source repository
REPO_BASE="${{ github.event.pull_request.head.base.full_name }}" # target repository
echo "This is pull request from $REPO_HEAD to $REPO_BASE"
Expand Down Expand Up @@ -82,15 +84,10 @@ jobs:
PUBLISH_VERSION="$REPO_VERSION_DESIRED"
RELEASE="true"
echo "This is push to master, and version was bumped from $REPO_VERSION_MOST_RECENT to $REPO_VERSION_DESIRED. Will publish a release of $REPO_VERSION_DESIRED."
elif [[ "${{ github.event_name }}" == "pull_request" ]]
then
PUBLISH_VERSION="$REPO_VERSION_MOST_RECENT-${{ github.run_number }}"
PRERELEASE="true"
echo "This is push to a non-master branch on a PR, and version was bumped from $REPO_VERSION_MOST_RECENT to $REPO_VERSION_DESIRED. Will publish a pre-release of $REPO_VERSION_DESIRED."
fi;
else
PUBLISH_VERSION="$REPO_VERSION_MOST_RECENT-$BRANCH_NAME-${{ github.run_number }}"
if [[ "${{ github.event_name }}" == "pull_request" && ${{ contains(github.event.pull_request.labels.*.name, 'pre-release') }} ]]
if [[ "${{ github.event_name }}" == "pull_request" && "${{ contains(github.event.pull_request.labels.*.name, 'pre-release') }}" == "true" ]]
then
PRERELEASE="true"
echo "This is a PR with `pre-release` label set. Will publish and prerelease version: $PUBLISH_VERSION."
Expand Down