From d4f5285400ae38f15be4d8b4636d1e4638178016 Mon Sep 17 00:00:00 2001 From: maurizio-cacace Date: Mon, 13 Mar 2023 16:18:48 +0100 Subject: [PATCH 1/2] ACS-4814 Use PR id for library publishing --- .github/actions/update-library-versions/action.yml | 2 +- .github/workflows/release.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/update-library-versions/action.yml b/.github/actions/update-library-versions/action.yml index 20eafdb628..61dd03708a 100644 --- a/.github/actions/update-library-versions/action.yml +++ b/.github/actions/update-library-versions/action.yml @@ -22,7 +22,7 @@ runs: if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then NEW_LIBRARY_VERSION="$VERSION_IN_PACKAGE_JSON" else - NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}" + NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${PR_NUMBER}" fi ./scripts/gh/update-lib-versions.sh "$NEW_LIBRARY_VERSION" "${{ inputs.dry-run }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44f1fd352e..9667887860 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -126,6 +126,17 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' - uses: ./.github/actions/setup + - name: check PR number + id: action + uses: kamatama41/get-pr-number-action@v0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: save PR number + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + echo "PR_NUMBER=${{ steps.action.outputs.number }}" >> $GITHUB_ENV - name: publish uses: ./.github/actions/publish-libs with: From 2ee8d18f16b44f102920ee29c99d7550984e2e1e Mon Sep 17 00:00:00 2001 From: maurizio-cacace Date: Tue, 14 Mar 2023 09:12:23 +0100 Subject: [PATCH 2/2] ACS-4814 Use PR id for library publishing --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9667887860..c7764119bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,7 @@ env: REPO_SLUG: "alfresco/alfresco-content-app" NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }} + jobs: publish-docker-registry: name: "Publish to Quay" @@ -132,8 +133,6 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} - name: save PR number - env: - GH_TOKEN: ${{ github.token }} shell: bash run: | echo "PR_NUMBER=${{ steps.action.outputs.number }}" >> $GITHUB_ENV