Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ jobs:
done
echo "Processed $conv TRX file(s)"


- name: Publish Test Report
if: always()
uses: ctrf-io/github-test-reporter@v1
Expand Down Expand Up @@ -186,24 +185,21 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Save PR Number
if: github.event_name == 'pull_request'
run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV

- name: Create PR Comment
if: always()
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'ctrf/**/*.json'

summary: true
pull-request: true
use-suite-name: true
update-comment: true
always-group-by: true
overwrite-comment: true
upload-artifact: false
- name: Write PR Number to File
if: github.event_name == 'pull_request'
run: echo "$PR_NUMBER" > pr_number.txt
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR_NUMBER environment variable may not be set when this step runs. The environment variable is set in the previous step (line 190), but the 'run' command in line 194 attempts to use it. Consider using the direct GitHub context value instead: echo "${{ github.event.pull_request.number }}" > pr_number.txt

Suggested change
run: echo "$PR_NUMBER" > pr_number.txt
run: echo "${{ github.event.pull_request.number }}" > pr_number.txt

Copilot uses AI. Check for mistakes.
shell: bash

pull-request-report: true
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload PR Number Artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt

- name: Summary
run: echo "All matrix test jobs completed."
run: echo "All matrix test jobs completed."
61 changes: 61 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Create PR Comments

on:
workflow_run:
workflows: ["Tests"]
types: [completed]

permissions:
contents: read
actions: read
pull-requests: write

jobs:
pr-comment:
name: Post Test Result as PR comment
runs-on: ubuntu-24.04
if: github.event.workflow_run.event == 'pull_request'

steps:
- name: Download CTRF artifact
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{ github.token }}
run_id: ${{ github.event.workflow_run.id }}
name: ctrf-report
path: ctrf

- name: Download PR Number Artifact
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{ github.token }}
run_id: ${{ github.event.workflow_run.id }}
name: pr_number
path: pr_number

- name: Read PR Number
run: |
PR_NUMBER=$(cat pr_number/pr_number.txt | grep -E '^[0-9]+$')
if [ -z "$PR_NUMBER" ]; then
Comment on lines +38 to +39
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation uses grep which will succeed if any line matches the pattern, but won't ensure the entire content is valid. Consider using a more robust validation: PR_NUMBER=$(cat pr_number/pr_number.txt | tr -d '\n' | grep -E '^[0-9]+$') to strip newlines first, or better yet: PR_NUMBER=$(cat pr_number/pr_number.txt); if ! [[ \"$PR_NUMBER\" =~ ^[0-9]+$ ]]; then echo \"Error: PR_NUMBER is not a valid integer.\"; exit 1; fi

Suggested change
PR_NUMBER=$(cat pr_number/pr_number.txt | grep -E '^[0-9]+$')
if [ -z "$PR_NUMBER" ]; then
PR_NUMBER=$(cat pr_number/pr_number.txt | tr -d '\n')
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then

Copilot uses AI. Check for mistakes.
echo "Error: PR_NUMBER is not a valid integer."
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
- name: Post PR Comment
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'ctrf/**/*.json'
issue: ${{ env.PR_NUMBER }}

summary: true
pull-request: true
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The pull-request: true parameter appears redundant when explicitly specifying issue: ${{ env.PR_NUMBER }}. This may cause confusion about whether the action should auto-detect the PR or use the provided issue number. Consider verifying the ctrf-io/github-test-reporter@v1 documentation to confirm if both parameters are needed or if one should be removed.

Suggested change
pull-request: true

Copilot uses AI. Check for mistakes.
use-suite-name: true
update-comment: true
always-group-by: true
overwrite-comment: true
upload-artifact: false

pull-request-report: true
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The pull-request-report: true parameter appears after upload-artifact: false and outside the main parameter block (lines 48-57), which may indicate it's redundant or incorrectly positioned given that pull-request reporting is already enabled via pull-request: true on line 52. Verify if this parameter is necessary or if it should be removed to avoid confusion.

Suggested change
pull-request-report: true

Copilot uses AI. Check for mistakes.
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions src/ElectronNET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{985D39A7-5216-4945-8167-2FD0CB387BD8}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
..\.github\workflows\integration-tests.yml = ..\.github\workflows\integration-tests.yml
..\.github\workflows\pr-comment.yml = ..\.github\workflows\pr-comment.yml
..\.github\workflows\publish-wiki.yml = ..\.github\workflows\publish-wiki.yml
..\.github\workflows\trailing-whitespace-check.yml = ..\.github\workflows\trailing-whitespace-check.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\nuke\_build.csproj", "{015CB06B-6CAE-209F-E050-21C3ACA5FE9F}"
Expand Down