Compare commits

..

2 Commits

Author SHA1 Message Date
codex-action
2a6464cc31 Fix CI failures for PR #551 2026-01-18 23:15:03 +00:00
Carlos Polop
1f6661816b Intentional failure for Codex fix test 2026-01-19 00:00:24 +01:00
3 changed files with 31 additions and 38 deletions

View File

@@ -10,7 +10,7 @@ jobs:
if: > if: >
${{ github.event.workflow_run.conclusion == 'failure' && ${{ github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.pull_requests && github.event.workflow_run.pull_requests &&
github.event.workflow_run.pull_requests[0] && github.event.workflow_run.pull_requests[0].user.login == 'carlospolop' &&
!startsWith(github.event.workflow_run.head_commit.message, 'Fix CI failures for PR #') }} !startsWith(github.event.workflow_run.head_commit.message, 'Fix CI failures for PR #') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
@@ -20,33 +20,10 @@ jobs:
actions: read actions: read
steps: steps:
- name: Resolve PR context
id: pr_context
env:
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')
{
echo "number=${PR_NUMBER}"
echo "author=${pr_author}"
echo "head_repo=${pr_head_repo}"
echo "head_branch=${pr_head_branch}"
} >> "$GITHUB_OUTPUT"
- name: Comment on PR with failure info - name: Comment on PR with failure info
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
uses: actions/github-script@v7 uses: actions/github-script@v7
env: env:
PR_NUMBER: ${{ steps.pr_context.outputs.number }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
RUN_URL: ${{ github.event.workflow_run.html_url }} RUN_URL: ${{ github.event.workflow_run.html_url }}
WORKFLOW_NAME: ${{ github.event.workflow_run.name }} WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
with: with:
@@ -62,22 +39,19 @@ jobs:
}); });
- name: Checkout PR head - name: Checkout PR head
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
repository: ${{ steps.pr_context.outputs.head_repo }} repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_sha }} ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0 fetch-depth: 0
persist-credentials: true persist-credentials: true
- name: Configure git author - name: Configure git author
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
run: | run: |
git config user.name "codex-action" git config user.name "codex-action"
git config user.email "codex-action@users.noreply.github.com" git config user.email "codex-action@users.noreply.github.com"
- name: Fetch failure summary - name: Fetch failure summary
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }} RUN_ID: ${{ github.event.workflow_run.id }}
@@ -105,11 +79,10 @@ jobs:
PY PY
- name: Create Codex prompt - name: Create Codex prompt
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
env: env:
PR_NUMBER: ${{ steps.pr_context.outputs.number }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
RUN_URL: ${{ github.event.workflow_run.html_url }} RUN_URL: ${{ github.event.workflow_run.html_url }}
HEAD_BRANCH: ${{ steps.pr_context.outputs.head_branch }} HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: | run: |
{ {
echo "You are fixing CI failures for PR #${PR_NUMBER} in ${{ github.repository }}." echo "You are fixing CI failures for PR #${PR_NUMBER} in ${{ github.repository }}."
@@ -125,7 +98,6 @@ jobs:
} > codex_prompt.txt } > codex_prompt.txt
- name: Run Codex - name: Run Codex
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
id: run_codex id: run_codex
uses: openai/codex-action@v1 uses: openai/codex-action@v1
with: with:
@@ -135,10 +107,9 @@ jobs:
model: gpt-5.2-codex model: gpt-5.2-codex
- name: Commit and push if changed - name: Commit and push if changed
if: ${{ steps.pr_context.outputs.author == 'carlospolop' }}
env: env:
TARGET_BRANCH: ${{ steps.pr_context.outputs.head_branch }} TARGET_BRANCH: ${{ github.event.workflow_run.head_branch }}
PR_NUMBER: ${{ steps.pr_context.outputs.number }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
run: | run: |
if git diff --quiet; then if git diff --quiet; then
echo "No changes to commit." echo "No changes to commit."
@@ -149,10 +120,10 @@ jobs:
git push origin HEAD:${TARGET_BRANCH} git push origin HEAD:${TARGET_BRANCH}
- name: Comment with Codex result - name: Comment with Codex result
if: ${{ steps.pr_context.outputs.author == 'carlospolop' && steps.run_codex.outputs.final-message != '' }} if: steps.run_codex.outputs.final-message != ''
uses: actions/github-script@v7 uses: actions/github-script@v7
env: env:
PR_NUMBER: ${{ steps.pr_context.outputs.number }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
CODEX_MESSAGE: ${{ steps.run_codex.outputs.final-message }} CODEX_MESSAGE: ${{ steps.run_codex.outputs.final-message }}
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}

View File

@@ -0,0 +1,7 @@
Job: Build_and_test_linpeas_pr (id 60731895947)
URL: https://github.com/peass-ng/PEASS-ng/actions/runs/21120092167/job/60731895947
Step: Build linpeas
Job: Build_and_test_macpeas_pr (id 60731895952)
URL: https://github.com/peass-ng/PEASS-ng/actions/runs/21120092167/job/60731895952
Step: Build macpeas

15
codex_prompt.txt Normal file
View File

@@ -0,0 +1,15 @@
You are fixing CI failures for PR #551 in peass-ng/PEASS-ng.
The failing workflow run is: https://github.com/peass-ng/PEASS-ng/actions/runs/21120092167
The PR branch is: codex-pr-failure-test-1
Failure summary:
Job: Build_and_test_linpeas_pr (id 60731895947)
URL: https://github.com/peass-ng/PEASS-ng/actions/runs/21120092167/job/60731895947
Step: Build linpeas
Job: Build_and_test_macpeas_pr (id 60731895952)
URL: https://github.com/peass-ng/PEASS-ng/actions/runs/21120092167/job/60731895952
Step: Build macpeas
Please identify the cause, apply a easy, simple and minimal fix, and update files accordingly.
Run any fast checks you can locally (no network).
Leave the repo in a state ready to commit as when you finish, it'll be automatically committed and pushed.