Skip to content

Commit d21f892

Browse files
authored
Merge pull request #126 from Azure-Samples/evaltest7
Fix evaluation workflow
2 parents a013681 + 10efa35 commit d21f892

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/evaluate.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,25 @@ jobs:
193193
body: `${summary}\n\n[Check the workflow run for more details](${actionsUrl}).`
194194
})
195195
196+
- name: Get PR branch name
197+
id: get_pr_branch
198+
uses: actions/github-script@v7
199+
with:
200+
script: |
201+
const prNumber = context.issue.number;
202+
const { data: pr } = await github.pulls.get({
203+
owner: context.repo.owner,
204+
repo: context.repo.repo,
205+
pull_number: prNumber
206+
});
207+
return { branch: pr.head.ref };
208+
196209
- name: Commit and push eval results
197210
if: ${{ success() }}
198211
run: |
199212
git config --global user.name "github-actions[bot]"
200213
git config --global user.email "github-actions[bot]@users.noreply.github.com"
201-
git checkout ${{ github.head_ref }}
214+
git checkout -b temp-branch
202215
git add evals/results/pr${{ github.event.issue.number }}
203216
git commit -m "Add evaluation results for PR #${{ github.event.issue.number }}"
204-
git push
217+
git push origin temp-branch:${{ steps.get_pr_branch.outputs.branch }}

0 commit comments

Comments
 (0)