fix: remove noreply mail#7
Conversation
WalkthroughUpdates the GitHub Actions workflow to capture Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/build_and_test.yml:
- Line 173: The workflow references the development branch ref
"svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow", which is
unstable; update that action reference in the GitHub Actions step (the uses:
line for run_trivy_scan_image) to point to a stable semantic version tag (e.g.,
@v1.2.3) or a specific commit SHA after the changes are merged and tagged in the
.github repository to ensure immutability and reliability.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build_and_test.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
.github/workflows/build_and_test.yml (2)
108-112: LGTM! Cleaner job ID capture.The refactored approach directly captures the job ID into a variable and outputs it, eliminating intermediate file operations. The logic correctly filters jobs by name and extracts the ID.
123-123: LGTM! Whitespace cleanup.Trailing whitespace removed with no functional impact.
| - name: Scan Docker image using Trivy and send mail if vulnerabilities detected | ||
| if: steps.check_commit_message.outputs.no_ci != 'true' && steps.check_commit_message.outputs.no_scan != 'true' | ||
| uses: svtechnmaa/.github/actions/run_trivy_scan_image@main | ||
| uses: svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow |
There was a problem hiding this comment.
Use stable action references instead of development branches.
Same concern as line 161: referencing @fix/workflow instead of a stable version creates reliability and security risks. Once the changes are merged and tagged in the .github repository, update this reference to use a semantic version tag or commit SHA.
📋 Recommended fix
After stabilizing the action in the .github repository:
- uses: svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow
+ uses: svtechnmaa/.github/actions/run_trivy_scan_image@v1.0.0Or use a commit SHA for immutability:
- uses: svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow
+ uses: svtechnmaa/.github/actions/run_trivy_scan_image@abc1234📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| uses: svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow | |
| uses: svtechnmaa/.github/actions/run_trivy_scan_image@v1.0.0 |
🤖 Prompt for AI Agents
In @.github/workflows/build_and_test.yml at line 173, The workflow references
the development branch ref
"svtechnmaa/.github/actions/run_trivy_scan_image@fix/workflow", which is
unstable; update that action reference in the GitHub Actions step (the uses:
line for run_trivy_scan_image) to point to a stable semantic version tag (e.g.,
@v1.2.3) or a specific commit SHA after the changes are merged and tagged in the
.github repository to ensure immutability and reliability.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/build_and_test.yml:
- Around line 114-142: Add an id to the step
("determine_commit_id_and_email_author"), stop relying only on GITHUB_ENV
(downstream code expects step outputs), and emit proper step outputs via
GITHUB_OUTPUT in shell-safe form; specifically, after computing
COMMITTER_NAME/COMMITTER_EMAIL set matching output names used later
(COMMIT_AUTHOR_NAME, COMMIT_AUTHOR_EMAIL, COMMIT_FULL_ID or whatever downstream
expects) by echoing to $GITHUB_OUTPUT, and also export to GITHUB_ENV if you
still need env variables; fix the GitHub expression fallbacks by evaluating them
outside unquoted shell expansions (use the workflow expression to set a default
env var or embed the fully-resolved value into a shell variable) so the fallback
assignment lines do not break the shell parser, and ensure the final output
variable names match the downstream references (either restore COMMIT_AUTHOR_*
variable names or update downstream to COMMITTER_* consistently).
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build_and_test.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
.github/workflows/build_and_test.yml (1)
108-112: LGTM! Cleaner implementation.The refactoring to capture job_id directly into a variable is cleaner and avoids intermediate file operations.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.github/workflows/build_and_test.yml:
- Around line 197-202: The workflow uses invalid step output references
(steps.determine_commit_id_and_email_author.outputs.* and
steps.get_job_id.outputs.job_id) for commit_id, mail_receivers,
commit_author_name, and job_id; replace those step-scoped references with the
corresponding environment variables (env.COMMIT_ID, env.COMMITTER_EMAIL,
env.COMMITTER_NAME, env.job_id or whatever env names are defined) and also
switch mail_username and mail_password to env.MAIL_USERNAME and
env.MAIL_PASSWORD so all keys (commit_id, mail_username, mail_password,
mail_receivers, commit_author_name, job_id) reference env.* instead of steps.*
outputs.
- Around line 183-188: The workflow is incorrectly reading step outputs from a
non-existent step ID determine_commit_id_and_email_author; replace references to
steps.determine_commit_id_and_email_author.outputs.COMMIT_ID, .COMMITTER_EMAIL
and .COMMITTER_NAME with env.COMMIT_ID, env.COMMITTER_EMAIL and
env.COMMITTER_NAME respectively (e.g., change commit_id: ${{
steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} to commit_id:
${{ env.COMMIT_ID }} and mail_receivers/commit_author_name similarly), leaving
other valid references (vars.* and secrets.* and
steps.get_job_id.outputs.job_id) unchanged.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build_and_test.yml
🧰 Additional context used
🪛 actionlint (1.7.10)
.github/workflows/build_and_test.yml
186-186: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
187-187: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
200-200: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
201-201: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
.github/workflows/build_and_test.yml (1)
108-112: LGTM! Clean refactoring of job ID capture.The direct capture of
job_ideliminates intermediate file operations and improves clarity.
| - name: Get Commit ID and Committer Info | ||
| run: | | ||
| COMMIT_ID=${{ env.COMMIT_FULL_ID }} | ||
| COMMIT_AUTHOR_EMAIL=$(git show -s --format='%ae' $COMMIT_ID) | ||
| COMMIT_AUTHOR_NAME=$(git show -s --format='%aN' $COMMIT_ID) | ||
| echo "COMMIT_ID=${COMMIT_ID}" >> $GITHUB_OUTPUT | ||
| echo "COMMIT_AUTHOR_EMAIL=${COMMIT_AUTHOR_EMAIL}" >> $GITHUB_OUTPUT | ||
| echo "COMMIT_AUTHOR_NAME=${COMMIT_AUTHOR_NAME}" >> $GITHUB_OUTPUT | ||
|
|
||
| # Get committer info | ||
| echo "Getting committer info for commit ID: $COMMIT_ID" | ||
| COMMITTER_EMAIL=$(git show -s --format='%ce' $COMMIT_ID) | ||
| COMMITTER_NAME=$(git show -s --format='%cn' $COMMIT_ID) | ||
|
|
||
| # Get author info if committer email is noreply | ||
| if [[ "$COMMITTER_EMAIL" == *noreply* ]]; then | ||
| echo "Committer email is noreply, getting author info..." | ||
| COMMITTER_NAME=$(git show -s --format='%an' $COMMIT_ID) | ||
| COMMITTER_EMAIL=$(git show -s --format='%ae' $COMMIT_ID) | ||
| fi | ||
|
|
||
| # Fallback to github event info if still noreply | ||
| if [[ "$COMMITTER_EMAIL" == *noreply* ]]; then | ||
| echo "Committer email is still noreply, using github event info..." | ||
| COMMITTER_NAME=${{ github.event.pusher.name || github.event.sender.login }} | ||
| COMMITTER_EMAIL=${{ github.event.pusher.email}} | ||
| fi | ||
|
|
||
| echo "COMMIT_ID=${COMMIT_ID}" >> $GITHUB_ENV | ||
| echo "COMMITTER_NAME=${COMMITTER_NAME}" >> $GITHUB_ENV | ||
| echo "COMMITTER_EMAIL=${COMMITTER_EMAIL}" >> $GITHUB_ENV | ||
| echo "COMMIT_ID: $COMMIT_ID" | ||
| echo "COMMITTER_NAME: $COMMITTER_NAME" | ||
| echo "COMMITTER_EMAIL: $COMMITTER_EMAIL" |
There was a problem hiding this comment.
Critical: Missing step ID and incorrect variable references.
This step has three critical issues that will cause the workflow to fail:
-
Missing
idattribute: The step is referenced downstream (lines 183, 186-187, 197, 200-201) assteps.determine_commit_id_and_email_author, but this step has noidattribute. -
Variables exported to GITHUB_ENV, not outputs: Lines 137-139 write to
GITHUB_ENV, but downstream steps access these as step outputs. Since you're usingGITHUB_ENV, downstream references should use${{ env.COMMITTER_EMAIL }}instead of step outputs. -
Incorrect GitHub context syntax in bash (lines 133-134): GitHub Actions expressions like
${{ github.event.pusher.name }}must be properly quoted in bash.
🐛 Proposed fix
- - name: Get Commit ID and Committer Info
+ - name: Get Commit ID and Committer Info
+ id: get_commit_and_committer_info
run: |
COMMIT_ID=${{ env.COMMIT_FULL_ID }}
# Get committer info
echo "Getting committer info for commit ID: $COMMIT_ID"
COMMITTER_EMAIL=$(git show -s --format='%ce' $COMMIT_ID)
COMMITTER_NAME=$(git show -s --format='%cn' $COMMIT_ID)
# Get author info if committer email is noreply
if [[ "$COMMITTER_EMAIL" == *noreply* ]]; then
echo "Committer email is noreply, getting author info..."
COMMITTER_NAME=$(git show -s --format='%an' $COMMIT_ID)
COMMITTER_EMAIL=$(git show -s --format='%ae' $COMMIT_ID)
fi
# Fallback to github event info if still noreply
if [[ "$COMMITTER_EMAIL" == *noreply* ]]; then
echo "Committer email is still noreply, using github event info..."
- COMMITTER_NAME=${{ github.event.pusher.name || github.event.sender.login }}
- COMMITTER_EMAIL=${{ github.event.pusher.email}}
+ COMMITTER_NAME="${{ github.event.pusher.name || github.event.sender.login }}"
+ COMMITTER_EMAIL="${{ github.event.pusher.email }}"
fi
echo "COMMIT_ID=${COMMIT_ID}" >> $GITHUB_ENV
echo "COMMITTER_NAME=${COMMITTER_NAME}" >> $GITHUB_ENV
echo "COMMITTER_EMAIL=${COMMITTER_EMAIL}" >> $GITHUB_ENV
echo "COMMIT_ID: $COMMIT_ID"
echo "COMMITTER_NAME: $COMMITTER_NAME"
echo "COMMITTER_EMAIL: $COMMITTER_EMAIL"Then update downstream references (see next comments).
Committable suggestion skipped: line range outside the PR's diff.
| commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} | ||
| mail_username: ${{ vars.MAIL_USERNAME }} | ||
| mail_password: ${{ secrets.MAIL_PASSWORD }} | ||
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | ||
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_NAME }} | ||
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | ||
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }} | ||
| job_id: ${{ steps.get_job_id.outputs.job_id }} |
There was a problem hiding this comment.
Critical: Update step references to use environment variables.
These lines reference a non-existent step ID determine_commit_id_and_email_author. Since the variables are exported to GITHUB_ENV (not step outputs), use env.* instead of steps.*.outputs.*.
🐛 Proposed fix
- commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }}
+ commit_id: ${{ env.COMMIT_ID }}
mail_username: ${{ vars.MAIL_USERNAME }}
mail_password: ${{ secrets.MAIL_PASSWORD }}
- mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }}
- commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }}
+ mail_receivers: ${{ env.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }}
+ commit_author_name: ${{ env.COMMITTER_NAME }}
job_id: ${{ steps.get_job_id.outputs.job_id }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} | |
| mail_username: ${{ vars.MAIL_USERNAME }} | |
| mail_password: ${{ secrets.MAIL_PASSWORD }} | |
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_NAME }} | |
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }} | |
| job_id: ${{ steps.get_job_id.outputs.job_id }} | |
| commit_id: ${{ env.COMMIT_ID }} | |
| mail_username: ${{ vars.MAIL_USERNAME }} | |
| mail_password: ${{ secrets.MAIL_PASSWORD }} | |
| mail_receivers: ${{ env.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ env.COMMITTER_NAME }} | |
| job_id: ${{ steps.get_job_id.outputs.job_id }} |
🧰 Tools
🪛 actionlint (1.7.10)
183-183: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
186-186: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
187-187: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
🤖 Prompt for AI Agents
In @.github/workflows/build_and_test.yml around lines 183 - 188, The workflow is
incorrectly reading step outputs from a non-existent step ID
determine_commit_id_and_email_author; replace references to
steps.determine_commit_id_and_email_author.outputs.COMMIT_ID, .COMMITTER_EMAIL
and .COMMITTER_NAME with env.COMMIT_ID, env.COMMITTER_EMAIL and
env.COMMITTER_NAME respectively (e.g., change commit_id: ${{
steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} to commit_id:
${{ env.COMMIT_ID }} and mail_receivers/commit_author_name similarly), leaving
other valid references (vars.* and secrets.* and
steps.get_job_id.outputs.job_id) unchanged.
| commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} | ||
| mail_username: ${{ vars.MAIL_USERNAME }} | ||
| mail_password: ${{ secrets.MAIL_PASSWORD }} | ||
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | ||
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_NAME }} | ||
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | ||
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }} | ||
| job_id: ${{ steps.get_job_id.outputs.job_id }} |
There was a problem hiding this comment.
Critical: Update step references to use environment variables.
Same issue as the previous Trivy scan step—these lines reference the non-existent step ID. Use env.* instead.
🐛 Proposed fix
- commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }}
+ commit_id: ${{ env.COMMIT_ID }}
mail_username: ${{ vars.MAIL_USERNAME }}
mail_password: ${{ secrets.MAIL_PASSWORD }}
- mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }}
- commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }}
+ mail_receivers: ${{ env.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }}
+ commit_author_name: ${{ env.COMMITTER_NAME }}
job_id: ${{ steps.get_job_id.outputs.job_id }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| commit_id: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_ID }} | |
| mail_username: ${{ vars.MAIL_USERNAME }} | |
| mail_password: ${{ secrets.MAIL_PASSWORD }} | |
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMIT_AUTHOR_NAME }} | |
| mail_receivers: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ steps.determine_commit_id_and_email_author.outputs.COMMITTER_NAME }} | |
| job_id: ${{ steps.get_job_id.outputs.job_id }} | |
| commit_id: ${{ env.COMMIT_ID }} | |
| mail_username: ${{ vars.MAIL_USERNAME }} | |
| mail_password: ${{ secrets.MAIL_PASSWORD }} | |
| mail_receivers: ${{ env.COMMITTER_EMAIL }},${{ vars.DEFAULT_MAIL_RECIPIENTS }} | |
| commit_author_name: ${{ env.COMMITTER_NAME }} | |
| job_id: ${{ steps.get_job_id.outputs.job_id }} |
🧰 Tools
🪛 actionlint (1.7.10)
197-197: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
200-200: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
201-201: property "determine_commit_id_and_email_author" is not defined in object type {check_commit_message: {conclusion: string; outcome: string; outputs: {string => string}}; check_existing_image: {conclusion: string; outcome: string; outputs: {string => string}}; get_job_id: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
🤖 Prompt for AI Agents
In @.github/workflows/build_and_test.yml around lines 197 - 202, The workflow
uses invalid step output references
(steps.determine_commit_id_and_email_author.outputs.* and
steps.get_job_id.outputs.job_id) for commit_id, mail_receivers,
commit_author_name, and job_id; replace those step-scoped references with the
corresponding environment variables (env.COMMIT_ID, env.COMMITTER_EMAIL,
env.COMMITTER_NAME, env.job_id or whatever env names are defined) and also
switch mail_username and mail_password to env.MAIL_USERNAME and
env.MAIL_PASSWORD so all keys (commit_id, mail_username, mail_password,
mail_receivers, commit_author_name, job_id) reference env.* instead of steps.*
outputs.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.