Skip to content

Commit

Permalink
CI: Stub Update with PAT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ax3l committed Nov 30, 2023
1 parent 58dc1ed commit 900cb84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
name: 👑 CI

# This workflow updates the .pyi stub files for documentation and interactive use.

on: [push, pull_request, pull_request_target]
on: [push, pull_request]

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

jobs:
stubs:
# Pushes should only run on mainline branch "development"
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
name: 🔄 Update Stub Files
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# changed files back to the repository.
contents: write
uses: ./.github/workflows/stubs.yml

ubuntu:
if: github.event_name != 'pull_request_target'
if: github.event.pull_request.draft == false
name: 🐧 Ubuntu
needs: [stubs]
uses: ./.github/workflows/ubuntu.yml

intel:
if: github.event_name != 'pull_request_target'
if: github.event.pull_request.draft == false
name: 🐧 Intel
needs: [stubs]
uses: ./.github/workflows/intel.yml

hip:
if: github.event_name != 'pull_request_target'
if: github.event.pull_request.draft == false
name: 🐧 HIP
needs: [stubs]
uses: ./.github/workflows/hip.yml

macos:
if: github.event_name != 'pull_request_target'
if: github.event.pull_request.draft == false
name: 🍏 macOS
needs: [stubs]
uses: ./.github/workflows/macos.yml

windows:
if: github.event_name != 'pull_request_target'
if: github.event.pull_request.draft == false
name: 🪟 Windows
needs: [stubs]
uses: ./.github/workflows/windows.yml

stubs:
if: github.event_name != 'pull_request'
name: 🔄 Update Stub Files
needs: [ubuntu, intel, hip, macos, windows]
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# changed files back to the repository.
contents: write
uses: ./.github/workflows/stubs.yml

save_pr_number:
if: github.event_name != 'push'
runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
CXXFLAGS: "-O1"
OMP_NUM_THREAD: 2

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

- name: Pull Remote Changes
run: git pull
Expand Down

0 comments on commit 900cb84

Please sign in to comment.