Skip to content

Commit

Permalink
chore: force checkout with ref input
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolovazzano authored Jul 1, 2022
1 parent 59399c7 commit c7e81b1
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -166,6 +170,8 @@ jobs:
steps:
- uses: actions/[email protected]
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
Expand Down Expand Up @@ -227,6 +233,8 @@ jobs:
steps:
- uses: actions/[email protected]
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
Expand Down Expand Up @@ -409,13 +417,14 @@ jobs:
steps:
- uses: actions/[email protected]
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
Expand All @@ -424,7 +433,6 @@ jobs:
echo "Version $version doesn't exist. INVALID INPUT."
exit 1
fi
set +x
- uses: azure/[email protected]
with:
Expand Down Expand Up @@ -580,6 +588,8 @@ jobs:
- uses: actions/[email protected]
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'

Expand Down Expand Up @@ -651,15 +661,17 @@ jobs:
steps:
- uses: actions/[email protected]
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 \
Expand All @@ -670,18 +682,18 @@ 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
# without protected branches can be use secrets.GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.SEMANTICRELEASE }}
run: |
npx semantic-release
- name: Version
id: version
run: |
Expand Down

0 comments on commit c7e81b1

Please sign in to comment.