From c7e81b16058fda2f7f1179229f7095178338e131 Mon Sep 17 00:00:00 2001 From: Marco Lovazzano <87663863+marcolovazzano@users.noreply.github.com> Date: Fri, 1 Jul 2022 09:28:48 +0200 Subject: [PATCH] chore: force checkout with ref input --- .github/workflows/release.yml | 46 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67a4d1072..b2a345d61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,8 +37,10 @@ jobs: steps: - uses: actions/checkout@v3 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} fetch-depth: 0 - + - name: Set modules required id: modules run: | @@ -56,35 +58,35 @@ jobs: arrIN=(${in//,/ }) for i in "${arrIN[@]}"; do case $i in - + fe-piattaforma) echo "::set-output name=fe-piattaforma::true" ;; - + ms-ente) echo "::set-output name=ms-ente::true" ;; - + ms-gestione-utente) echo "::set-output name=ms-gestione-utente::true" ;; - + ms-notifiche-integration) echo "::set-output name=ms-notifiche-integration::true" ;; - + ms-open-data) echo "::set-output name=ms-open-data::true" ;; - + ms-programma-progetto) echo "::set-output name=ms-programma-progetto::true" ;; - + ms-questionario-cittadino) echo "::set-output name=ms-questionario-cittadino::true" ;; - + *) echo "Unknown $i" exit 1 @@ -100,7 +102,7 @@ jobs: echo "::set-output name=ms-programma-progetto::true" echo "::set-output name=ms-questionario-cittadino::true" fi - + DryRunRelease: needs: CheckInputModules name: Dry-Run Release @@ -111,6 +113,8 @@ jobs: steps: - uses: actions/checkout@v3 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} fetch-depth: 0 - name: Setup Node.js environment @@ -166,6 +170,8 @@ jobs: steps: - uses: actions/checkout@v3.0.2 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} lfs: 'true' - name: Setup Node.js @@ -227,6 +233,8 @@ jobs: steps: - uses: actions/checkout@v3.0.2 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} lfs: 'true' - name: Set up JDK 11 @@ -409,13 +417,14 @@ jobs: steps: - uses: actions/checkout@v3.0.2 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} fetch-depth: '0' - name: Check Input Version if: ${{ github.event.inputs.version != '' }} id: checkver run: | - set -x version="${{ github.event.inputs.version }}" echo "==> Version: $version" if [ $(git tag -l "$version" | wc -l) -gt 0 ]; then @@ -424,7 +433,6 @@ jobs: echo "Version $version doesn't exist. INVALID INPUT." exit 1 fi - set +x - uses: azure/setup-kubectl@v2.1 with: @@ -580,6 +588,8 @@ jobs: - uses: actions/checkout@v3.0.2 with: token: ${{ secrets.SEMANTICRELEASE }} + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} persist-credentials: 'true' fetch-depth: '0' @@ -651,15 +661,17 @@ jobs: steps: - uses: actions/checkout@v3.0.2 with: + # this allow the workflow to be rerun after changes have been pushed from previous jobs + ref: ${{ github.ref }} token: ${{ secrets.SEMANTICRELEASE }} persist-credentials: 'true' fetch-depth: '0' - + - name: Setup Node.js environment uses: actions/setup-node@v3 with: node-version: 'lts/*' - + - name: Install semantic-release extra plugins run: | npm install --save-dev \ @@ -670,10 +682,10 @@ jobs: @semantic-release/release-notes-generator \ @semantic-release/exec \ conventional-changelog-conventionalcommits - + - name: Create .VERSION file run: echo "There are no relevant changes, so no new version is released" > .VERSION - + - name: Release env: # ad-hoc token (PAT) in order to permit the push on a protected branch @@ -681,7 +693,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.SEMANTICRELEASE }} run: | npx semantic-release - + - name: Version id: version run: |