-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add msft contrib workflow, background tasks; switch assign/label to b…
…ackground task; switch remaining to exit codes instead of statuses API
- Loading branch information
Showing
6 changed files
with
104 additions
and
20 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 |
---|---|---|
@@ -1,23 +1,41 @@ | ||
name: Auto label and assign pull requests | ||
name: Assign and label PR | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
actions: read | ||
|
||
on: [pull_request_target] | ||
on: | ||
workflow_run: | ||
workflows: [Background tasks] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
download-payload: | ||
name: Download and extract payload artifact | ||
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-ExtractPayload.yml@workflows-prod | ||
with: | ||
WorkflowId: ${{ github.event.workflow_run.id }} | ||
OrgRepo: ${{ github.repository }} | ||
secrets: | ||
AccessToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
auto-label-assign: | ||
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoLabelAssign.yml@workflows-prod | ||
with: | ||
PayloadJson: ${{ toJSON(github) }} | ||
AutoAssignUsers: 1 | ||
AutoLabel: 1 | ||
ExcludedUserList: '["user1", "user2"]' | ||
ExcludedBranchList: '["branch1", "branch2"]' | ||
secrets: | ||
AccessToken: ${{ secrets.GITHUB_TOKEN }} | ||
label-assign: | ||
name: Run assign and label | ||
needs: [download-payload] | ||
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoLabelAssign.yml@workflows-prod | ||
with: | ||
PayloadJson: ${{ needs.download-payload.outputs.WorkflowPayload }} | ||
AutoAssignUsers: 1 | ||
AutoLabel: 1 | ||
ExcludedUserList: '["user1", "user2"]' | ||
ExcludedBranchList: '["branch1", "branch2"]' | ||
secrets: | ||
AccessToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,40 @@ | ||
name: Auto label Microsoft contributors | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
actions: read | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Background tasks] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
download-payload: | ||
if: github.repository_visibility == 'public' | ||
name: Download and extract payload artifact | ||
uses: MicrosoftDocs/max-cpub-test/.github/workflows/Shared-ExtractPayload.yml@main | ||
with: | ||
WorkflowId: ${{ github.event.workflow_run.id }} | ||
OrgRepo: ${{ github.repository }} | ||
secrets: | ||
AccessToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
label-msft: | ||
name: Label Microsoft contributors | ||
if: github.repository_visibility == 'public' | ||
needs: [download-payload] | ||
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoLabelMsftContributor.yml@workflows-test | ||
with: | ||
PayloadJson: ${{ needs.download-payload.outputs.WorkflowPayload }} | ||
secrets: | ||
AccessToken: ${{ secrets.GITHUB_TOKEN }} | ||
TeamReadAccessToken: ${{ secrets.ORG_READTEAMS_TOKEN }} | ||
|
||
|
||
|
||
|
||
|
||
|
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,26 @@ | ||
name: Background tasks | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
|
||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Save payload data | ||
env: | ||
PayloadJson: ${{ toJSON(github) }} | ||
AccessToken: ${{ github.token }} | ||
run: | | ||
mkdir -p ./pr | ||
echo $PayloadJson > ./pr/PayloadJson.json | ||
sed -i -e "s/$AccessToken/XYZ/g" ./pr/PayloadJson.json | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: PayloadJson | ||
path: pr/ |
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