Skip to content
Merged
Show file tree
Hide file tree
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
41 changes: 41 additions & 0 deletions .github/workflows/gh-pr-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create a Pull Request

on:
workflow_dispatch:
inputs:
repo:
description: 'Repositório de destino (ex: owner/repo-name)'
required: true
source_branch:
description: 'Branch de origem (head)'
required: true
target_branch:
description: 'Branch de destino (base)'
required: true
title:
description: 'Título do Pull Request'
required: true
body:
description: 'Corpo do Pull Request'
required: false

permissions:
contents: write
pull-requests: write

jobs:
create_pr:
runs-on: ubuntu-latest
steps:
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh pr create \
--repo ${{ github.event.inputs.repo }} \
--title "${{ github.event.inputs.title }}" \
--body "${{ github.event.inputs.body }}" \
--head ${{ github.event.inputs.source_branch }} \
--base ${{ github.event.inputs.target_branch }}

echo "::notice title=Criação de PR Concluída::O Pull Request foi criado com sucesso."
25 changes: 25 additions & 0 deletions .github/workflows/gh-pr-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Merge Squesh a Pull Request

on:
workflow_dispatch:
inputs:
pr_url:
description: 'Pull Request link.'
required: true
default: 'https://github.com/owner/repo-name/pull/1'

permissions:
contents: write
pull-requests: write

jobs:
merge_pr:
runs-on: ubuntu-latest
steps:
- name: Merge Squash a Pull Request
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh pr merge ${{ github.event.inputs.pr_url }} --squash

echo "::notice title=Merge Concluído::O Pull Request foi mesclado com sucesso."
Loading