Skip to content

Commit 4ea67ac

Browse files
authored
CI: Stub Update with PAT (#227)
Created a scoped personal access token to use checkout and push. This should help with the sporadic 403 errors, likely from timeouts of the checkout permissions: stefanzweifel/git-auto-commit-action#305
1 parent 58dc1ed commit 4ea67ac

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
11
name: 👑 CI
22

3-
# This workflow updates the .pyi stub files for documentation and interactive use.
4-
5-
on: [push, pull_request, pull_request_target]
3+
on: [push, pull_request]
64

75
concurrency:
86
group: ${{ github.ref }}-${{ github.head_ref }}-ci
97
cancel-in-progress: true
108

119
jobs:
10+
stubs:
11+
# Pushes should only run on mainline branch "development"
12+
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
13+
name: 🔄 Update Stub Files
14+
permissions:
15+
# Give the default GITHUB_TOKEN write permission to commit and push the
16+
# changed files back to the repository.
17+
contents: write
18+
uses: ./.github/workflows/stubs.yml
19+
1220
ubuntu:
13-
if: github.event_name != 'pull_request_target'
21+
if: github.event.pull_request.draft == false
1422
name: 🐧 Ubuntu
23+
needs: [stubs]
1524
uses: ./.github/workflows/ubuntu.yml
1625

1726
intel:
18-
if: github.event_name != 'pull_request_target'
27+
if: github.event.pull_request.draft == false
1928
name: 🐧 Intel
29+
needs: [stubs]
2030
uses: ./.github/workflows/intel.yml
2131

2232
hip:
23-
if: github.event_name != 'pull_request_target'
33+
if: github.event.pull_request.draft == false
2434
name: 🐧 HIP
35+
needs: [stubs]
2536
uses: ./.github/workflows/hip.yml
2637

2738
macos:
28-
if: github.event_name != 'pull_request_target'
39+
if: github.event.pull_request.draft == false
2940
name: 🍏 macOS
41+
needs: [stubs]
3042
uses: ./.github/workflows/macos.yml
3143

3244
windows:
33-
if: github.event_name != 'pull_request_target'
45+
if: github.event.pull_request.draft == false
3446
name: 🪟 Windows
47+
needs: [stubs]
3548
uses: ./.github/workflows/windows.yml
3649

37-
stubs:
38-
if: github.event_name != 'pull_request'
39-
name: 🔄 Update Stub Files
40-
needs: [ubuntu, intel, hip, macos, windows]
41-
permissions:
42-
# Give the default GITHUB_TOKEN write permission to commit and push the
43-
# changed files back to the repository.
44-
contents: write
45-
uses: ./.github/workflows/stubs.yml
46-
4750
save_pr_number:
4851
if: github.event_name != 'push'
4952
runs-on: ubuntu-latest

.github/workflows/stubs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
CXXFLAGS: "-O1"
2020
OMP_NUM_THREAD: 2
2121

22-
if: github.event.pull_request.draft == false
2322
permissions:
2423
# Give the default GITHUB_TOKEN write permission to commit and push the
2524
# changed files back to the repository.
@@ -28,8 +27,7 @@ jobs:
2827
steps:
2928
- uses: actions/checkout@v3
3029
with:
31-
repository: ${{ github.event.pull_request.head.repo.full_name }}
32-
ref: ${{ github.head_ref }}
30+
token: ${{ secrets.PYAMREX_PUSH_TOKEN }}
3331

3432
- name: Pull Remote Changes
3533
run: git pull

0 commit comments

Comments
 (0)