-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dotnet:main' into 19109-fix
- Loading branch information
Showing
385 changed files
with
5,202 additions
and
1,796 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,73 @@ | ||
# When all check suites are completed successfully, the workflow adds a label to the pull request. | ||
# When a new check suite is requested (or rerequested), the workflow removes the label from the pull request. | ||
name: Manage Label on Check Suites | ||
|
||
on: | ||
check_suite: | ||
types: [completed, requested, rerequested] | ||
|
||
jobs: | ||
add-label: | ||
if: github.event.action == 'completed' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check if all check suites are successful | ||
id: check_suites | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { data: checkSuites } = await github.checks.listSuitesForRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: context.payload.check_suite.head_sha, | ||
}); | ||
const allSuccessful = checkSuites.check_suites.every( | ||
suite => suite.conclusion === 'success' || suite.conclusion === 'skipped'); | ||
if (allSuccessful) { | ||
return { success: true }; | ||
} else { | ||
return { success: false }; | ||
} | ||
- name: Add label if all check suites are successful | ||
if: steps.check_suites.outputs.success == 'true' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const pullRequest = context.payload.check_suite.pull_requests[0]; | ||
if (pullRequest) { | ||
github.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: pullRequest.number, | ||
labels: 'all-checks-passed', | ||
}); | ||
} | ||
remove-label: | ||
if: github.event.action == 'requested' || github.event.action == 'rerequested' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Remove label when check suite is triggered or re-requested | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const pullRequest = context.payload.check_suite.pull_requests[0]; | ||
if (pullRequest) { | ||
github.issues.removeLabel({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: pullRequest.number, | ||
name: 'all-checks-passed', | ||
}); | ||
} |
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
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
Oops, something went wrong.