mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2026-01-19 04:19:02 +00:00
Compare commits
1 Commits
fix-pr-fai
...
fix-pr-fai
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08c4c6fc1d |
31
.github/workflows/pr-failure-codex-dispatch.yml
vendored
31
.github/workflows/pr-failure-codex-dispatch.yml
vendored
@@ -26,15 +26,26 @@ jobs:
|
||||
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
pr_author=$(gh api -H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \
|
||||
--jq '.user.login')
|
||||
pr_head_repo=$(gh api -H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \
|
||||
--jq '.head.repo.full_name')
|
||||
pr_head_branch=$(gh api -H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \
|
||||
--jq '.head.ref')
|
||||
pr_json=$(gh api -H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.repository }}/pulls/${PR_NUMBER})
|
||||
pr_author=$(printf "%s" "$pr_json" | python3 - <<'PY'
|
||||
import json,sys
|
||||
data=json.load(sys.stdin)
|
||||
print(data.get("user",{}).get("login",""))
|
||||
PY
|
||||
)
|
||||
pr_head_repo=$(printf "%s" "$pr_json" | python3 - <<'PY'
|
||||
import json,sys
|
||||
data=json.load(sys.stdin)
|
||||
print(data.get("head",{}).get("repo",{}).get("full_name",""))
|
||||
PY
|
||||
)
|
||||
pr_head_branch=$(printf "%s" "$pr_json" | python3 - <<'PY'
|
||||
import json,sys
|
||||
data=json.load(sys.stdin)
|
||||
print(data.get("head",{}).get("ref",""))
|
||||
PY
|
||||
)
|
||||
{
|
||||
echo "number=${PR_NUMBER}"
|
||||
echo "author=${pr_author}"
|
||||
@@ -144,9 +155,7 @@ jobs:
|
||||
echo "No changes to commit."
|
||||
exit 0
|
||||
fi
|
||||
rm -f codex_failure_summary.txt codex_prompt.txt
|
||||
git add -A
|
||||
git reset -- codex_failure_summary.txt codex_prompt.txt
|
||||
git commit -m "Fix CI failures for PR #${PR_NUMBER}"
|
||||
git push origin HEAD:${TARGET_BRANCH}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user