Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 71 additions & 71 deletions .github/workflows/write-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
name: Changelog (Merge PR)

on:
pull_request:
types:
- closed
branches:
- main # Si attiva solo per le PR che si uniscono al branch 'main'

jobs:
release:
# Esegue il job solo se la PR è stata *unita* (merged)
if: github.event.pull_request.merged == true

permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest

steps:
- name: Checkout del Codice
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configurazione Utente Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Esecuzione di Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:

# ice all'azione di non cercare e aggiornare nessun file di versione perché non esiste il package,json
skip-version-file: true
# Genera il changelog e determina il nuovo numero di versione
github-token: ${{ secrets.GITHUB_TOKEN }}

# Rimosso: 'git-tag: true' (è l'impostazione predefinita)
# Rimosso: 'skip-unstable: true' (sostituita da 'pre-release')

output-file: CHANGELOG.md # Aggiorna il file CHANGELOG.md

# L'opzione 'skip-tag: false' omettiamo di specificarla,
# poiché vogliamo creare il tag.

- name: Verifica se è stata creata una nuova versione
id: check_version
# Uso 'tag_name' che è un alias per 'tag' (presente nell'elenco degli input validi)
run: echo "NEW_VERSION_TAG=${{ steps.changelog.outputs.tag }}" >> $GITHUB_ENV

- name: Push del CHANGELOG e del Tag
if: env.NEW_VERSION_TAG != ''
run: |
git add CHANGELOG.md
git commit -m "chore(release): ${{ env.NEW_VERSION_TAG }}" || echo "Nessun cambiamento da committare"
git push
# Spinge il tag. Il tag viene creato implicitamente dall'azione precedente.
git push origin ${{ env.NEW_VERSION_TAG }}

- name: Crea GitHub Release
if: env.NEW_VERSION_TAG != ''
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog.outputs.clean_changelog }}
tag_name: ${{ env.NEW_VERSION_TAG }}
name: Release ${{ env.NEW_VERSION_TAG }}
draft: false
prerelease: false
#name: Changelog (Merge PR)
#
#on:
# pull_request:
# types:
# - closed
# branches:
# - main # Si attiva solo per le PR che si uniscono al branch 'main'
#
#jobs:
# release:
# # Esegue il job solo se la PR è stata *unita* (merged)
# if: github.event.pull_request.merged == true
#
# permissions:
# contents: write
# pull-requests: write
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout del Codice
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Configurazione Utente Git
# run: |
# git config user.name 'github-actions[bot]'
# git config user.email 'github-actions[bot]@users.noreply.github.com'
#
# - name: Esecuzione di Conventional Changelog Action
# id: changelog
# uses: TriPSs/conventional-changelog-action@v3
# with:
#
# # ice all'azione di non cercare e aggiornare nessun file di versione perché non esiste il package,json
# skip-version-file: true
# # Genera il changelog e determina il nuovo numero di versione
# github-token: ${{ secrets.GITHUB_TOKEN }}
#
# # Rimosso: 'git-tag: true' (è l'impostazione predefinita)
# # Rimosso: 'skip-unstable: true' (sostituita da 'pre-release')
#
# output-file: CHANGELOG.md # Aggiorna il file CHANGELOG.md
#
# # L'opzione 'skip-tag: false' omettiamo di specificarla,
# # poiché vogliamo creare il tag.
#
# - name: Verifica se è stata creata una nuova versione
# id: check_version
# # Uso 'tag_name' che è un alias per 'tag' (presente nell'elenco degli input validi)
# run: echo "NEW_VERSION_TAG=${{ steps.changelog.outputs.tag }}" >> $GITHUB_ENV
#
# - name: Push del CHANGELOG e del Tag
# if: env.NEW_VERSION_TAG != ''
# run: |
# git add CHANGELOG.md
# git commit -m "chore(release): ${{ env.NEW_VERSION_TAG }}" || echo "Nessun cambiamento da committare"
# git push
# # Spinge il tag. Il tag viene creato implicitamente dall'azione precedente.
# git push origin ${{ env.NEW_VERSION_TAG }}
#
# - name: Crea GitHub Release
# if: env.NEW_VERSION_TAG != ''
# uses: softprops/action-gh-release@v1
# with:
# body: ${{ steps.changelog.outputs.clean_changelog }}
# tag_name: ${{ env.NEW_VERSION_TAG }}
# name: Release ${{ env.NEW_VERSION_TAG }}
# draft: false
# prerelease: false