Skip to content

Commit

Permalink
Adiciona configuração no workflow do GitHub para mostrar o link do PR…
Browse files Browse the repository at this point in the history
… no commit (#92)

issue [Configurar automerge dos PRs sem utilizar kodiak](monde-sistemas/melhorias#349)

No commit, estava mostrando apenas o título e os detalhes do PR. Não tinha o link do PR. Estou adicionando essa configuração para mostrar o link do PR no commit.
Também estou alterando a forma de fazer o merge, removendo o pascalgn/automerge-action porque ele estava [falhando em alguns PRs](https://github.com/monde-sistemas/m2/actions/runs/12121505151/job/33793229889). Encontrei pascalgn/automerge-action#122 sobre o problema.
  • Loading branch information
adriely-dourado authored Dec 3, 2024
1 parent b4accc1 commit 7342296
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: ci

on: [push, pull_request]
on:
pull_request:
types: [labeled, synchronize]
push:
branches: [master]

jobs:
qa:
Expand Down Expand Up @@ -35,11 +39,17 @@ jobs:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Merge pull request
uses: pascalgn/[email protected]
run: |
PR_NUMBER=$(basename "$PR_URL")
PR_TITLE=$(gh pr view "$PR_NUMBER" --json title -q ".title")
PR_BODY=$(gh pr view "$PR_NUMBER" --json body -q ".body")
COMMIT_MESSAGE="${PR_TITLE} (#${PR_NUMBER})"
gh pr merge "$PR_URL" --auto --squash --subject "$COMMIT_MESSAGE" --body "$PR_BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: "automerge"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "pull-request-title-and-description"
MERGE_DELETE_BRANCH: "true"
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7342296

Please sign in to comment.