Skip to content

Commit

Permalink
♻️ Refactored job ID to URI in workflow
Browse files Browse the repository at this point in the history
- Replaced the `job_id` variable with `job_uri` for better clarity and accuracy
- Updated the run URL construction to use the new `job_uri`
- This change improves readability and maintainability of the code
  • Loading branch information
Corantin committed Oct 17, 2024
1 parent 5994790 commit 204e1e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ai-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
- name: Get current job ID
id: get-job-id
run: |
job_id=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ github.job }}") | .url')
echo "job_id=$job_id" >> $GITHUB_OUTPUT
job_uri=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ github.job }}") | .url')
echo "job_uri=$job_uri" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -109,7 +109,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const runUrl = `https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ steps.get-job-id.outputs.job_id }}#step:8:1`;
const runUrl = `${{ steps.get-job-id.outputs.job_uri }}#step:8:1`;
const commentBody = `Gemini Code Review encountered an error. [View the run here](${runUrl}).\n\nSee **Code Review by Gemini AI** step as it may still contains some review before failing.`;
github.rest.issues.createComment({
issue_number: context.issue.number,
Expand Down

0 comments on commit 204e1e6

Please sign in to comment.