diff --git a/.github/workflows/update-elixir-patches.yaml b/.github/workflows/update-elixir-patches.yaml index 9d956116357..4e7556e613b 100644 --- a/.github/workflows/update-elixir-patches.yaml +++ b/.github/workflows/update-elixir-patches.yaml @@ -17,17 +17,20 @@ jobs: - elixir_version: "1.14" name: '1_14' timeout-minutes: 10 + env: + branch: bump-elixir-${{ matrix.elixir_version }} steps: - name: CHECKOUT REPOSITORY uses: actions/checkout@v3 - - name: SKIP IF THE PR ALREADY EXISTS + - name: FAIL IF THE PR ALREADY EXISTS id: check-for-branch run: | set +e - git ls-remote --exit-code --heads origin bump-elixir-${{ matrix.elixir_version }} - echo "::set-output name=c::$?" + if git ls-remote --exit-code --heads origin ${{ env.branch }}; then + echo "Branch ${{ env.branch }} already exits" + exit 1 + fi - name: DETERMINE LATEST PATCH & SHA - if: steps.check-for-branch.outputs.c != 0 id: fetch-version run: | TAG_NAME=$(curl -s GET https://api.github.com/repos/elixir-lang/elixir/tags?per_page=100 \ @@ -47,10 +50,9 @@ jobs: exit 1 fi - echo "::set-output name=VERSION::${TAG_NAME#v}" - echo "::set-output name=SHA::${SHA}" + echo "VERSION=${TAG_NAME#v}" >> $GITHUB_OUTPUT + echo "SHA=${SHA}" >> $GITHUB_OUTPUT - name: MODIFY VERSION FILE - if: steps.check-for-branch.outputs.c != 0 run: | sudo npm install --global --silent @bazel/buildozer @@ -67,8 +69,7 @@ jobs: set -x git diff - name: CREATE PULL REQUEST - if: steps.check-for-branch.outputs.c != 0 - uses: peter-evans/create-pull-request@v4.2.3 + uses: peter-evans/create-pull-request@v5.0.0 with: token: ${{ secrets.REPO_SCOPED_TOKEN }} committer: GitHub @@ -84,6 +85,5 @@ jobs: labels: | backport-v3.11.x backport-v3.10.x - backport-v3.9.x - branch: bump-elixir-${{ matrix.elixir_version }} + branch: ${{ env.branch }} delete-branch: true diff --git a/.github/workflows/update-otp-patches.yaml b/.github/workflows/update-otp-patches.yaml index d7ca6c610c5..0a20080e88f 100644 --- a/.github/workflows/update-otp-patches.yaml +++ b/.github/workflows/update-otp-patches.yaml @@ -48,19 +48,22 @@ jobs: backport-v3.11.x backport-v3.10.x timeout-minutes: 10 + env: + branch: bump-otp-${{ matrix.erlang_version }} steps: - name: CHECKOUT REPOSITORY uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} - - name: SKIP IF THE PR ALREADY EXISTS + - name: FAIL IF THE PR ALREADY EXISTS id: check-for-branch run: | set +e - git ls-remote --exit-code --heads origin bump-otp-${{ matrix.erlang_version }} - echo "::set-output name=c::$?" + if git ls-remote --exit-code --heads origin ${{ env.branch }}; then + echo "Branch ${{ env.branch }} already exits" + exit 1 + fi - name: DETERMINE LATEST PATCH & SHA - if: steps.check-for-branch.outputs.c != 0 id: fetch-version run: | TAG_NAME=$(curl -s GET https://api.github.com/repos/erlang/otp/tags?per_page=100 \ @@ -90,11 +93,10 @@ jobs: exit 1 fi - echo "::set-output name=VERSION::${VERSION}" - echo "::set-output name=SHA::${SHA}" - echo "::set-output name=SHA2::${SHA2}" + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + echo "SHA=${SHA}" >> $GITHUB_OUTPUT + echo "SHA2=${SHA2}" >> $GITHUB_OUTPUT - name: MODIFY VERSION FILE - if: steps.check-for-branch.outputs.c != 0 run: | sudo npm install --global --silent @bazel/buildozer @@ -141,8 +143,7 @@ jobs: set -x git diff - name: CREATE PULL REQUEST - if: steps.check-for-branch.outputs.c != 0 - uses: peter-evans/create-pull-request@v4.2.3 + uses: peter-evans/create-pull-request@v5.0.0 with: token: ${{ secrets.REPO_SCOPED_TOKEN }} committer: GitHub @@ -156,5 +157,5 @@ jobs: commit-message: | Adopt otp ${{ steps.fetch-version.outputs.VERSION }} labels: ${{ matrix.labels }} - branch: bump-otp-${{ matrix.erlang_version }} + branch: ${{ env.branch }} delete-branch: true