Skip to content

pdk-update

pdk-update #204

Workflow file for this run

name: 'On PDK update'
on:
repository_dispatch:
types: [pdk-update]
jobs:
trigger:
runs-on: ubuntu-22.04
steps:
- uses: benc-uk/workflow-dispatch@v1
with:
ref: main
workflow: push.yml
prepare:
runs-on: ubuntu-22.04
outputs:
pr-data: ${{ steps.list.outputs.result }}
steps:
- uses: myparcelnl/actions/setup-app-credentials@v4
id: credentials
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
- name: 'Get pull requests'
id: list
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
#language=javascript
script: |
const { data } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
return data.map(pr => ({
number: pr.number,
ref: pr.head.ref
}));
trigger-prs:
needs: prepare
runs-on: ubuntu-22.04
strategy:
matrix:
pr: ${{ fromJSON(needs.prepare.outputs.pr-data) }}
steps:
- uses: myparcelnl/actions/repository-dispatch@v4
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
event-type: trigger-pr-build
client-payload: ${{ toJSON(matrix.pr) }}