Skip to content

ci: get a list of changed files using git diff instead of GitHub APIv4 #122

ci: get a list of changed files using git diff instead of GitHub APIv4

ci: get a list of changed files using git diff instead of GitHub APIv4 #122

---
"name": "Build Notebooks (pr)"
"on":
"pull_request":
permissions:
contents: read
packages: read
pull-requests: read
jobs:
gen:
name: Generate job matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
has_jobs: ${{ steps.gen.outputs.has_jobs }}
steps:
- uses: actions/checkout@v4
- run: |
git fetch --no-tags --prune -u --progress origin 'pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}'
git fetch '+refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}`
python3 ci/cached-builds/gen_gha_matrix_jobs.py \
--from-ref='${{ github.pull_request.base.ref }}' \
--to-ref='${{ github.sha }}' \
id: gen
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
needs: ["gen"]
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.gen.outputs.matrix) }}"
uses: ./.github/workflows/build-notebooks-TEMPLATE.yaml
if: ${{ fromJson(needs.gen.outputs.has_jobs) }}
with:
target: "${{ matrix.target }}"
github: "${{ toJSON(github) }}"
secrets: inherit