Skip to content

Eperez

Eperez #47

Workflow file for this run

name: Issue al abrir una pull request
on:
pull_request:
types:
- opened
- reopened
jobs:
abririssue:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.create_issue.outputs.issue_id }}
steps:
- uses: actions/checkout@v4
with:
path: .
- name: Crear issue
run: |
pull_request_url="${{ github.event.pull_request.html_url }}"
issue_body="This issue is related to pull request: [${pull_request_url}](${pull_request_url})"
echo "issue_id=$(gh issue create --title "I found a bug" --body "${issue_body}" -a "EperezStemdo" | cut -d"/" -f7)" >> "$GITHUB_OUTPUT"
id: create_issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cerrarissue:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
needs: abririssue
steps:
- uses: actions/checkout@v4
- name: Añadir close a la pr
run: |
gh pr edit ${{ github.event.number }} --body "Close #${{ needs.abririssue.outputs.output1 }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}