Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe PR updates GitHub Actions workflows ( Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as "GitHub Actions Runner\n(ubuntu-latest)"
participant Tests as "Test Job(s)\n(pytest shards)"
participant ArtifactStore as "GitHub Artifact Storage"
participant AllureCLI as "npx Allure CLI + allure-action"
participant PagesDeploy as "actions/deploy-pages\n(GitHub Pages)"
Runner->>Tests: run tests & produce `allure-results` shards
Tests->>ArtifactStore: upload shards (actions/upload-artifact)
Runner->>Runner: build-report job downloads shards (actions/download-artifact)
Runner->>AllureCLI: merge results & generate `allure-report` (npx allure generate)
AllureCLI->>ArtifactStore: upload `allure-report` (upload-pages-artifact)
PagesDeploy->>ArtifactStore: download `allure-report` artifact
PagesDeploy->>PagesDeploy: deploy to GitHub Pages (actions/deploy-pages)
PagesDeploy->>Runner: expose page URL via environment output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Allure Report Summary
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/devRun.yml:
- Around line 45-47: The workflow step named "Link Git Information And Browser
Version To Allure Results" uses working-directory: allure-results and if:
always(), which causes failures when the allure-results folder doesn't exist;
add a prior step (or incorporate into the job setup) that ensures the directory
exists (e.g., run a mkdir -p allure-results or equivalent) before the named step
runs so that the working-directory is valid even when tests fail early,
referencing the step label "Link Git Information And Browser Version To Allure
Results" and the working-directory value "allure-results" when updating the
YAML.
- Around line 50-52: Avoid expanding `${{ github.head_ref }}` directly in the
shell; instead set GIT_BRANCH via the job/step env (e.g., env: GIT_BRANCH: ${{
github.head_ref || github.ref_name }}) and then reference the safe environment
variable in the script with quoting (echo GIT_BRANCH="$GIT_BRANCH"); do
similarly for any other interpolated values if needed (BUILD_URL and
GIT_COMMIT_ID can be set via env and echoed as "$BUILD_URL" and
"$GIT_COMMIT_ID") to prevent branch-name injection.
| - name: Link Git Information And Browser Version To Allure Results | ||
| if: always() | ||
| working-directory: allure-results |
There was a problem hiding this comment.
Prevent failures when allure-results is missing.
With working-directory: allure-results and if: always(), this step fails if tests didn’t create the folder (e.g., early failure), which then blocks report generation/deploy. Consider creating the directory beforehand.
🛠️ Suggested hardening
- name: Auto-assign reviewers
uses: kentaro-m/auto-assign-action@v2.0.0
if: success()
+ - name: Ensure Allure results directory exists
+ if: always()
+ run: mkdir -p allure-results
- name: Link Git Information And Browser Version To Allure Results
if: always()
working-directory: allure-results🤖 Prompt for AI Agents
In @.github/workflows/devRun.yml around lines 45 - 47, The workflow step named
"Link Git Information And Browser Version To Allure Results" uses
working-directory: allure-results and if: always(), which causes failures when
the allure-results folder doesn't exist; add a prior step (or incorporate into
the job setup) that ensures the directory exists (e.g., run a mkdir -p
allure-results or equivalent) before the named step runs so that the
working-directory is valid even when tests fail early, referencing the step
label "Link Git Information And Browser Version To Allure Results" and the
working-directory value "allure-results" when updating the YAML.
| echo BUILD_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| echo GIT_BRANCH=${{ github.head_ref || github.ref_name }} | ||
| echo GIT_COMMIT_ID=${{ github.sha }} |
There was a problem hiding this comment.
Avoid untrusted github.head_ref expansion in shell.
Line 51 interpolates ${{ github.head_ref }} directly into the script, which can allow PR branch-name injection. Pass it via env and quote in the shell.
🔒 Proposed fix
- name: Link Git Information And Browser Version To Allure Results
if: always()
working-directory: allure-results
+ env:
+ GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
{
echo BUILD_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- echo GIT_BRANCH=${{ github.head_ref || github.ref_name }}
+ echo "GIT_BRANCH=$GIT_BRANCH"
echo GIT_COMMIT_ID=${{ github.sha }}
echo GIT_COMMIT_MESSAGE="$(git show -s --format=%s HEAD)"🤖 Prompt for AI Agents
In @.github/workflows/devRun.yml around lines 50 - 52, Avoid expanding `${{
github.head_ref }}` directly in the shell; instead set GIT_BRANCH via the
job/step env (e.g., env: GIT_BRANCH: ${{ github.head_ref || github.ref_name }})
and then reference the safe environment variable in the script with quoting
(echo GIT_BRANCH="$GIT_BRANCH"); do similarly for any other interpolated values
if needed (BUILD_URL and GIT_COMMIT_ID can be set via env and echoed as
"$BUILD_URL" and "$GIT_COMMIT_ID") to prevent branch-name injection.
Description
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.