Skip to content

Remove 'pull_request_target' trigger #1095

Remove 'pull_request_target' trigger

Remove 'pull_request_target' trigger #1095

Workflow file for this run

name: Agrega comentario a PR

Check warning on line 1 in .github/workflows/pr-comment.yml

View workflow run for this annotation

GitHub Actions / Agrega comentario a PR

Workflow execution policy warning (evaluate mode)

Event 'pull_request_target' is not allowed to trigger Actions workflows. Workflow file: '.github/workflows/pr-comment.yml'.
on:
workflow_run:
workflows: ["TODO"]
types: [completed]
permissions: {}
jobs:
write-comment:
runs-on: ubuntu-22.04
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
pull-requests: write
steps:
- uses: actions/download-artifact@v5
continue-on-error: true
with:
name: missing-entries
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- name: TODO
id: pr
env:
GH_TOKEN: ${{ github.token }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
if [[ ! -f pr-number ]]; then
echo 'TODO'
exit 0
fi
pr="$(head -n1 pr-number)"
if [[ ! "$pr" =~ ^[0-9]+$ ]]; then
echo 'TODO'
exit 1
fi
actual_sha="$(gh api "repos/$GITHUB_REPOSITORY/pulls/$pr" --jq .head.sha)"
if [[ "actual_sha" != "$HEAD_SHA" ]]; then
echo 'TODO'
exit 0
fi
echo "pr=$pr" >> "$GITHUB_OUTPUT"
- name: Agregar comentario con entradas faltantes
if: steps.pr.outputs.pr != ''
uses: thollander/actions-comment-pull-request@v3
with:
file-path: comment.md
pr-number: ${{ steps.pr.outputs.pr }}
comment-tag: missing-entries