From 98d3fc6bba5250b4feb9b0128d3c873a2e8fab35 Mon Sep 17 00:00:00 2001 From: Louan Fontenele Date: Sun, 29 Dec 2024 00:10:10 -0300 Subject: [PATCH] Update release-windows-dotnet.yml --- .github/workflows/release-windows-dotnet.yml | 32 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-windows-dotnet.yml b/.github/workflows/release-windows-dotnet.yml index 0f6a3ff..f30c748 100644 --- a/.github/workflows/release-windows-dotnet.yml +++ b/.github/workflows/release-windows-dotnet.yml @@ -4,7 +4,7 @@ on: push: branches: - master - workflow_dispatch: # Permite execução manual + workflow_dispatch: # Allows manual execution jobs: release: @@ -14,7 +14,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Pega todas as tags existentes + fetch-depth: 0 # Fetch all existing tags - name: Setup .NET uses: actions/setup-dotnet@v3 @@ -32,6 +32,34 @@ jobs: - name: Create Zip Archive run: zip -r release.zip release/ + # Detect changes in the .github directory + - name: Check for .github changes + id: changes + run: | + if git diff --name-only HEAD^ | grep '^\.github/'; then + echo "changes_in_github=true" >> $GITHUB_ENV + else + echo "changes_in_github=false" >> $GITHUB_ENV + fi + + # Apply label if changes are detected in .github + - name: Label PR with ignore-changelog + if: env.changes_in_github == 'true' && github.event_name == 'pull_request' + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { owner, repo } = context.repo; + const pr = context.payload.pull_request; + if (pr) { + github.rest.issues.addLabels({ + owner, + repo, + issue_number: pr.number, + labels: ['ignore-changelog'] + }); + } + - name: Generate Version Tag id: tag run: |