-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: v2 event-types versioning (#15549)
* Added a log for pull_request * Added labels logging * Using labels straight from event PR object * Converting to JSON * Switching to use payload * Fixed issue with undefined pr * Fixed non-mapping issue * Removed the types * Added another cache key segment using the head commit sha * Added separate workflow for labeled action * Fixed syntax error * Fixing payload issue * Added log * logging full object * Put e2e back in the names to help find them * Limited logging * fix: v2 even-types versioning * test: old v2 even-types request with VERSION_2024_06_11 * test: old v2 even-types request with VERSION_2024_04_15 --------- Co-authored-by: Keith Williams <[email protected]>
- Loading branch information
1 parent
928dd49
commit 08f4a48
Showing
6 changed files
with
99 additions
and
10 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
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,54 @@ | ||
name: PR Labeled with ready-for-e2e | ||
|
||
on: | ||
pull_request_target: | ||
types: [labeled] | ||
branches: | ||
- main | ||
- gh-actions-test-branch | ||
workflow_dispatch: | ||
jobs: | ||
run-e2e-jobs: | ||
name: Run E2E Jobs | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
permissions: | ||
pull-requests: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/dangerous-git-checkout | ||
|
||
- name: Check Label and Retrigger Checks | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const labelName = context.payload.label.name; | ||
const prNumber = context.payload.pull_request.number; | ||
const owner = context.repo.owner; | ||
const repo = context.repo.repo; | ||
if (labelName === 'ready-for-e2e') { | ||
console.log(`Running E2E jobs for PR #${prNumber}...`); | ||
const checkRuns = await github.rest.checks.listForRef({ | ||
owner, | ||
repo, | ||
ref: context.payload.pull_request.head.sha, | ||
}); | ||
for (const check of checkRuns.data.check_runs) { | ||
console.log('check.name', check.name); | ||
if (check.name.includes('e2e')) { | ||
await github.rest.actions.reRunJob({ | ||
owner, | ||
repo, | ||
job_id: check.id, | ||
}); | ||
console.log(`Triggering job #${check.id}`); | ||
} | ||
} | ||
console.log(`Triggered E2E checks for PR #${prNumber}`); | ||
} else { | ||
console.log(`Label ${labelName} does not trigger re-running checks.`); | ||
} |
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
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
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
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