update script (#222)
Browse files* update script
* remove comment
.github/workflows/model-results-comparison.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
name: Model Results Comparison
|
2 |
|
3 |
on:
|
4 |
-
|
5 |
types: [opened, synchronize, edited]
|
6 |
paths:
|
7 |
- 'results/**/*.json'
|
@@ -14,7 +14,7 @@ on:
|
|
14 |
default: 'intfloat/multilingual-e5-large google/gemini-embedding-001'
|
15 |
pull_request_number:
|
16 |
description: 'The pull request number to comment on (required if triggered manually)'
|
17 |
-
required: false
|
18 |
type: string
|
19 |
|
20 |
permissions:
|
@@ -29,6 +29,8 @@ jobs:
|
|
29 |
- name: Checkout code
|
30 |
uses: actions/checkout@v4
|
31 |
with:
|
|
|
|
|
32 |
fetch-depth: 0
|
33 |
|
34 |
- name: Fetch origin main
|
@@ -49,10 +51,16 @@ jobs:
|
|
49 |
run: |
|
50 |
python scripts/create_pr_results_comment.py --reference-models $REFERENCE_MODELS --output model-comparison.md
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
- name: Determine PR Number
|
53 |
id: pr_info
|
54 |
run: |
|
55 |
-
if [ "${{ github.event_name }}" == "
|
56 |
echo "pr_number=${{ github.event.number }}" >> $GITHUB_OUTPUT
|
57 |
elif [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.pull_request_number }}" ]; then
|
58 |
echo "pr_number=${{ github.event.inputs.pull_request_number }}" >> $GITHUB_OUTPUT
|
@@ -61,14 +69,7 @@ jobs:
|
|
61 |
fi
|
62 |
|
63 |
- name: Post PR comment
|
64 |
-
# This step will run if a PR number is available either from the PR event or workflow_dispatch input
|
65 |
if: steps.pr_info.outputs.pr_number != ''
|
66 |
env:
|
67 |
GITHUB_TOKEN: ${{ github.token }}
|
68 |
run: gh pr comment ${{ steps.pr_info.outputs.pr_number }} --body-file model-comparison.md --create-if-none --edit-last
|
69 |
-
|
70 |
-
- name: Upload comparison report
|
71 |
-
uses: actions/upload-artifact@v4
|
72 |
-
with:
|
73 |
-
name: model-comparison
|
74 |
-
path: model-comparison.md
|
|
|
1 |
name: Model Results Comparison
|
2 |
|
3 |
on:
|
4 |
+
pull_request_target:
|
5 |
types: [opened, synchronize, edited]
|
6 |
paths:
|
7 |
- 'results/**/*.json'
|
|
|
14 |
default: 'intfloat/multilingual-e5-large google/gemini-embedding-001'
|
15 |
pull_request_number:
|
16 |
description: 'The pull request number to comment on (required if triggered manually)'
|
17 |
+
required: false
|
18 |
type: string
|
19 |
|
20 |
permissions:
|
|
|
29 |
- name: Checkout code
|
30 |
uses: actions/checkout@v4
|
31 |
with:
|
32 |
+
# IMPORTANT: For pull_request_target, check out the PR branch explicitly
|
33 |
+
ref: ${{ github.event.pull_request.head.sha }}
|
34 |
fetch-depth: 0
|
35 |
|
36 |
- name: Fetch origin main
|
|
|
51 |
run: |
|
52 |
python scripts/create_pr_results_comment.py --reference-models $REFERENCE_MODELS --output model-comparison.md
|
53 |
|
54 |
+
- name: Upload comparison report
|
55 |
+
uses: actions/upload-artifact@v4
|
56 |
+
with:
|
57 |
+
name: model-comparison
|
58 |
+
path: model-comparison.md
|
59 |
+
|
60 |
- name: Determine PR Number
|
61 |
id: pr_info
|
62 |
run: |
|
63 |
+
if [ "${{ github.event_name }}" == "pull_request_target" ]; then
|
64 |
echo "pr_number=${{ github.event.number }}" >> $GITHUB_OUTPUT
|
65 |
elif [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.pull_request_number }}" ]; then
|
66 |
echo "pr_number=${{ github.event.inputs.pull_request_number }}" >> $GITHUB_OUTPUT
|
|
|
69 |
fi
|
70 |
|
71 |
- name: Post PR comment
|
|
|
72 |
if: steps.pr_info.outputs.pr_number != ''
|
73 |
env:
|
74 |
GITHUB_TOKEN: ${{ github.token }}
|
75 |
run: gh pr comment ${{ steps.pr_info.outputs.pr_number }} --body-file model-comparison.md --create-if-none --edit-last
|
|
|
|
|
|
|
|
|
|
|
|