Skip to content

Commit 2abdfc4

Browse files
committed
ci: improve gh acions jobs stability
1 parent a022a31 commit 2abdfc4

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/release-pr-update.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,22 @@ jobs:
6363
git fetch origin main "$RELEASE_BRANCH"
6464
git checkout -B "$RELEASE_BRANCH" "origin/$RELEASE_BRANCH"
6565
git rebase origin/main
66+
- name: Prepare Codex output
67+
if: steps.find.outputs.found == 'true'
68+
id: codex-output
69+
run: |
70+
set -euo pipefail
71+
output_dir=".tmp/codex/outputs"
72+
output_file="${output_dir}/release-review.md"
73+
mkdir -p "$output_dir"
74+
echo "output_file=${output_file}" >> "$GITHUB_OUTPUT"
6675
- name: Run Codex release review
6776
if: steps.find.outputs.found == 'true'
6877
uses: openai/codex-action@v1
6978
with:
7079
openai-api-key: ${{ secrets.PROD_OPENAI_API_KEY }}
7180
prompt-file: .github/codex/prompts/release-review.md
72-
output-file: release-review.md
81+
output-file: ${{ steps.codex-output.outputs.output_file }}
7382
safety-strategy: drop-sudo
7483
sandbox: read-only
7584
- name: Update PR body and push
@@ -78,10 +87,11 @@ jobs:
7887
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7988
PR_NUMBER: ${{ steps.find.outputs.number }}
8089
RELEASE_BRANCH: ${{ steps.find.outputs.branch }}
90+
RELEASE_REVIEW_PATH: ${{ steps.codex-output.outputs.output_file }}
8191
run: |
8292
set -euo pipefail
8393
git push --force-with-lease origin "$RELEASE_BRANCH"
84-
gh pr edit "$PR_NUMBER" --body-file release-review.md
94+
gh pr edit "$PR_NUMBER" --body-file "$RELEASE_REVIEW_PATH"
8595
milestone_name="$(python - <<'PY'
8696
import os
8797
import re

.github/workflows/release-pr.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,31 @@ jobs:
9292
fi
9393
git commit -m "Bump version to ${RELEASE_VERSION}"
9494
git push --set-upstream origin "$branch"
95+
- name: Prepare Codex output
96+
id: codex-output
97+
run: |
98+
set -euo pipefail
99+
output_dir=".tmp/codex/outputs"
100+
output_file="${output_dir}/release-review.md"
101+
mkdir -p "$output_dir"
102+
echo "output_file=${output_file}" >> "$GITHUB_OUTPUT"
95103
- name: Run Codex release review
96104
uses: openai/codex-action@v1
97105
with:
98106
openai-api-key: ${{ secrets.PROD_OPENAI_API_KEY }}
99107
prompt-file: .github/codex/prompts/release-review.md
100-
output-file: release-review.md
108+
output-file: ${{ steps.codex-output.outputs.output_file }}
101109
safety-strategy: drop-sudo
102110
sandbox: read-only
103111
- name: Build PR body
112+
env:
113+
RELEASE_REVIEW_PATH: ${{ steps.codex-output.outputs.output_file }}
104114
run: |
105115
python - <<'PY'
116+
import os
106117
import pathlib
107118
108-
report = pathlib.Path("release-review.md").read_text()
119+
report = pathlib.Path(os.environ["RELEASE_REVIEW_PATH"]).read_text()
109120
pathlib.Path("pr-body.md").write_text(report)
110121
PY
111122
- name: Create or update PR

0 commit comments

Comments
 (0)