diff --git a/.github/workflows/master-pr.yml b/.github/workflows/master-pr.yml index 1193a75..06e5e04 100644 --- a/.github/workflows/master-pr.yml +++ b/.github/workflows/master-pr.yml @@ -9,22 +9,23 @@ jobs: steps: - name: Checkout PR branch uses: actions/checkout@v3 - + - name: Get version from PR branch id: pr_version run: | - PR_VERSION=$(grep '' **/*.csproj | sed -E 's/.*(.*)<\/Version>.*/\1/') + PR_VERSION=$(find . -name '*.csproj' -exec grep '' {} \; | sed -E 's/.*(.*)<\/Version>.*/\1/') echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV - - name: Checkout master branch - run: | - git fetch origin master - git checkout origin/master + - name: Checkout master branch to separate directory + uses: actions/checkout@v3 + with: + ref: master + path: master_branch - name: Get version from master branch id: master_version run: | - MASTER_VERSION=$(grep '' **/*.csproj | sed -E 's/.*(.*)<\/Version>.*/\1/') + MASTER_VERSION=$(find master_branch -name '*.csproj' -exec grep '' {} \; | sed -E 's/.*(.*)<\/Version>.*/\1/') echo "MASTER_VERSION=$MASTER_VERSION" >> $GITHUB_ENV - name: Compare versions