forked from kubeflow/notebooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: trigger workflows for PRs with
ok-to-test
label (kubeflow#204)
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
- Loading branch information
1 parent
bc6f311
commit 6d04cff
Showing
4 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Approve Workflow Runs | ||
|
||
permissions: | ||
actions: write | ||
contents: read | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- labeled | ||
- synchronize | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ok-to-test: | ||
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Approve Pending Workflow Runs | ||
uses: actions/github-script@v7 | ||
with: | ||
retries: 3 | ||
script: | | ||
const request = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
event: "pull_request", | ||
status: "action_required", | ||
head_sha: context.payload.pull_request.head.sha, | ||
} | ||
core.info(`Getting workflow runs that need approval for commit ${request.head_sha}`) | ||
const runs = await github.paginate(github.rest.actions.listWorkflowRunsForRepo, request) | ||
core.info(`Found ${runs.length} workflow runs that need approval`) | ||
for (const run of runs) { | ||
core.info(`Approving workflow run ${run.id}`) | ||
const request = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: run.id, | ||
} | ||
await github.rest.actions.approveWorkflowRun(request) | ||
} |
20 changes: 15 additions & 5 deletions
20
.github/workflows/ui-bff-build.yml → .github/workflows/ws-backend-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletions
18
.github/workflows/controller-tests.yaml → .github/workflows/ws-controller-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 18 additions & 6 deletions
24
.github/workflows/ui-frontend-build.yml → .github/workflows/ws-frontend-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters