From f51750c948ff5d1e2e4227974ff7cb870dbda29f Mon Sep 17 00:00:00 2001 From: Pamela Fox Date: Thu, 24 Oct 2024 14:26:27 +0000 Subject: [PATCH 1/2] Test --- .github/workflows/evaluate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evaluate.yaml b/.github/workflows/evaluate.yaml index 6cf2bfa1..6f0b72a8 100644 --- a/.github/workflows/evaluate.yaml +++ b/.github/workflows/evaluate.yaml @@ -56,7 +56,7 @@ jobs: body: "Starting evaluation! Check the Actions tab for progress, or wait for a comment with the results." }) - - name: Checkout pull request 🏁 + - name: Checkout pull request uses: actions/checkout@v4 with: ref: refs/pull/${{ github.event.issue.number }}/head From d49bd0b3cbc3c3bfbe24473d048501781c08f25d Mon Sep 17 00:00:00 2001 From: Pamela Fox Date: Thu, 24 Oct 2024 15:54:27 +0000 Subject: [PATCH 2/2] Change checkout approach --- .github/workflows/evaluate.yaml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/evaluate.yaml b/.github/workflows/evaluate.yaml index 6f0b72a8..4d19c591 100644 --- a/.github/workflows/evaluate.yaml +++ b/.github/workflows/evaluate.yaml @@ -58,8 +58,11 @@ jobs: - name: Checkout pull request uses: actions/checkout@v4 - with: - ref: refs/pull/${{ github.event.issue.number }}/head + + - name: Checkout Pull Request + run: hub pr checkout ${{ github.event.issue.number }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install pgvector run: | @@ -193,25 +196,11 @@ jobs: body: `${summary}\n\n[Check the workflow run for more details](${actionsUrl}).` }) - - name: Get PR branch name - id: get_pr_branch - uses: actions/github-script@v7 - with: - script: | - const prNumber = context.issue.number; - const { data: pr } = await github.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: prNumber - }); - return { branch: pr.head.ref }; - - name: Commit and push eval results if: ${{ success() }} run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b temp-branch git add evals/results/pr${{ github.event.issue.number }} git commit -m "Add evaluation results for PR #${{ github.event.issue.number }}" - git push origin temp-branch:${{ steps.get_pr_branch.outputs.branch }} + git push