Skip to content

Commit 20445b5

Browse files
committed
Configure git and try again
1 parent 63830c4 commit 20445b5

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.github/actions/run-examples/action.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ inputs:
88
runner-os:
99
description: 'Runner OS'
1010
required: true
11+
repository:
12+
description: 'Repository name this pull request is initiated from'
13+
required: false
1114
head-ref:
1215
description: 'Head ref of the repo'
13-
required: true
16+
required: false
17+
default: 'main'
18+
token:
19+
description: 'Github token'
20+
required: false
1421
update-results:
1522
description: 'Whether to update the results for this run. Must be false for nightly runs'
1623
required: true
@@ -26,6 +33,9 @@ runs:
2633

2734
# Configure Run Examples environment
2835
- uses: actions/checkout@v4
36+
with:
37+
token: ${{ inputs.token }}
38+
fetch-depth: 0
2939

3040
- name: Patch tests/test_examples_run.yaml check with modified files
3141
shell: bash
@@ -81,10 +91,10 @@ runs:
8191
git config --local user.name github-actions[bot]
8292
git config --local user.email 41898282+github-actions[bot]@users.noreply.github.com
8393
git status
84-
git pull
94+
git pull origin ${{ inputs.head-ref }}
8595
git add tests/results/
8696
git diff --cached --quiet || git commit -s -m "github-actions[bot]: Run examples: updated result files on your behalf"
87-
git push
97+
git push origin ${{ inputs.head-ref }}
8898
8999
- name: Check if pytest passed
90100
shell: bash

.github/workflows/run-examples-prep.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
# Detect modified PDL files, includes Add, Modified, but not Deleted
1818
- uses: actions/checkout@v4
1919
with:
20+
token: ${{ github.token }}
2021
fetch-depth: 0
2122
- name: Detect all PDL files that were changed or added
2223
id: changed-pdl-files
@@ -47,7 +48,9 @@ jobs:
4748
runner-os: ${{ runner.os }}
4849
update-results: ${{ steps.parse-run-examples-config.outputs.update_results }}
4950
check: ${{ steps.changed-pdl-files.outputs.all_changed_files }}
50-
head-ref: ${{ github.head_ref }}
51+
head-ref: ${{ github.event.pull_request.head.ref }}
52+
repository: ${{ github.event.repository.full_name }}
53+
token: ${{ github.token }}
5154

5255
# Patch config with update_results to false
5356
- name: Patch tests/test_examples_run.yaml with update_results to False, only for the last matrix version

.github/workflows/run-examples.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
runner-os: ${{ runner.os }}
25+
repository: ${{ github.repository }}
2526
head-ref: ${{ github.head_ref }}
27+
token: ${{ github.token }}
2628
update-results: 'false'
2729
check: '[]' # Empty list means run against all PDL programs
30+

0 commit comments

Comments
 (0)