Skip to content

Update ejercicio3.yml #44

Update ejercicio3.yml

Update ejercicio3.yml #44

Workflow file for this run

name: Issue al abrir una pull requestw
on:
push:
branches:
- '*'
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:
runs-on: ubuntu-latest
needs: abririssue
steps:
- uses: actions/checkout@v4
- name: Añadir close a la pr
run: |
gh pr comment ${{ github.event.number }} --body "Close #${{ needs.abririssue.outputs.output1 }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}