From 6cfabf86a91ac40d34855d9d7ba7bf8823ba5914 Mon Sep 17 00:00:00 2001 From: Benevanio Santos Date: Thu, 11 Jun 2026 15:18:46 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20corre=C3=A7=C3=A3o=20do=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/block-master-pr.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/block-master-pr.yml b/.github/workflows/block-master-pr.yml index a2d0398..5f165aa 100644 --- a/.github/workflows/block-master-pr.yml +++ b/.github/workflows/block-master-pr.yml @@ -10,17 +10,26 @@ jobs: runs-on: ubuntu-latest steps: - - name: Comment and close PR + - name: Check source branch and block if not develop uses: actions/github-script@v7 with: script: | + const sourceBranch = context.payload.pull_request.head.ref; + + if (sourceBranch === 'develop') { + console.log(`✅ PR de ${sourceBranch} para master permitido.`); + return; + } + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: '❌ Pull Requests para master não são permitidos. Utilize a branch develop.' + body: `❌ Pull Requests diretamente para **master** são permitidos apenas a partir da branch **develop**. + Origem detectada: \`${sourceBranch}\`. + Por favor, primeiro faça o merge da sua branch na \`develop\` e então abra um PR de \`develop\` para \`master\`.` }); - + await github.rest.pulls.update({ owner: context.repo.owner, repo: context.repo.repo,