Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ejercicio3.yml #20

Merged
merged 1 commit into from
Apr 30, 2024
Merged
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
16 changes: 16 additions & 0 deletions .github/workflows/ejercicio3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ jobs:
gh issue create --title "I found a bug" --body "${issue_body}" -a "EperezStemdo"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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})"
gh issue create --title "I found a bug" --body "${issue_body}" -a "EperezStemdo"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cerrar issue cuando se cierra la pull request
if: github.event.pull_request.merged == true || github.event.pull_request.closed_at != null
#github.event.pull_request.closed_at != null es una condición que verifica si el campo closed_at en el JSON del evento de la solicitud de extracción tiene un valor diferente de null. Este campo contiene la fecha y hora en que se cerró la solicitud de extracción.
run: |
issue_number=$(echo '${{ github.event.pull_request.number }}')
gh issue close $issue_number
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}