Skip to content

Commit 71dc0b0

Browse files
Merge pull request #1148 from MicrosoftDocs/main
[AutoPublish] main to live - 04/23 15:42 PDT | 04/24 04:12 IST
2 parents d259f72 + 29bd349 commit 71dc0b0

3 files changed

Lines changed: 77 additions & 15 deletions

File tree

.github/workflows/AutoLabelAssign.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@ on:
1212
- completed
1313

1414
jobs:
15+
config:
16+
if: github.repository_owner == 'MicrosoftDocs'
17+
runs-on: ubuntu-latest
18+
outputs:
19+
AutoAssignUsers: ${{ steps.read.outputs.AutoAssignUsers }}
20+
AutoAssignReviewers: ${{ steps.read.outputs.AutoAssignReviewers }}
21+
AutoLabel: ${{ steps.read.outputs.AutoLabel }}
22+
ExcludedUserList: ${{ steps.read.outputs.ExcludedUserList }}
23+
ExcludedBranchList: ${{ steps.read.outputs.ExcludedBranchList }}
24+
steps:
25+
- uses: actions/checkout@v5
26+
with:
27+
sparse-checkout: .github/workflow-config.json
28+
sparse-checkout-cone-mode: false
29+
- id: read
30+
shell: pwsh
31+
run: |
32+
$Config = (Get-Content '.github/workflow-config.json' | ConvertFrom-Json).AutoLabelAssign
33+
"AutoAssignUsers=$($Config.AutoAssignUsers)" >> $Env:GITHUB_OUTPUT
34+
"AutoAssignReviewers=$($Config.AutoAssignReviewers)" >> $Env:GITHUB_OUTPUT
35+
"AutoLabel=$($Config.AutoLabel)" >> $Env:GITHUB_OUTPUT
36+
"ExcludedUserList=$($Config.ExcludedUserList | ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT
37+
"ExcludedBranchList=$($Config.ExcludedBranchList | ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT
38+
1539
download-payload:
1640
name: Download and extract payload artifact
1741
if: github.repository_owner == 'MicrosoftDocs'
@@ -25,16 +49,18 @@ jobs:
2549
label-assign:
2650
name: Run assign and label
2751
if: github.repository_owner == 'MicrosoftDocs'
28-
needs: [download-payload]
29-
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoLabelAssign.yml@workflows-prod
52+
needs: [config, download-payload]
53+
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoLabelAssign.yml@workflows-test
3054
with:
3155
PayloadJson: ${{ needs.download-payload.outputs.WorkflowPayload }}
32-
AutoAssignUsers: 1
33-
AutoAssignReviewers: 1
34-
AutoLabel: 1
35-
ExcludedUserList: '["user1", "user2"]'
36-
ExcludedBranchList: '["branch1", "branch2"]'
56+
AutoAssignUsers: ${{ fromJSON(needs.config.outputs.AutoAssignUsers) }}
57+
AutoAssignReviewers: ${{ fromJSON(needs.config.outputs.AutoAssignReviewers) }}
58+
AutoLabel: ${{ fromJSON(needs.config.outputs.AutoLabel) }}
59+
ExcludedUserList: ${{ needs.config.outputs.ExcludedUserList }}
60+
ExcludedBranchList: ${{ needs.config.outputs.ExcludedBranchList }}
3761
secrets:
3862
AccessToken: ${{ secrets.GITHUB_TOKEN }}
3963
PrivateKey: ${{ secrets.M365_APP_PRIVATE_KEY }}
40-
ClientId: ${{ secrets.M365_APP_CLIENT_ID }}
64+
ClientId: ${{ secrets.M365_APP_CLIENT_ID }}
65+
66+

.github/workflows/AutoPublish.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: (Scheduled) Publish to live
32

43
permissions:
@@ -15,15 +14,33 @@ on:
1514

1615
jobs:
1716

17+
config:
18+
if: github.repository_owner == 'MicrosoftDocs' && contains(github.event.repository.topics, 'build')
19+
runs-on: ubuntu-latest
20+
outputs:
21+
EnableAutoPublish: ${{ steps.read.outputs.EnableAutoPublish }}
22+
EnableAutoMerge: ${{ steps.read.outputs.EnableAutoMerge }}
23+
steps:
24+
- uses: actions/checkout@v5
25+
with:
26+
sparse-checkout: .github/workflow-config.json
27+
sparse-checkout-cone-mode: false
28+
- id: read
29+
shell: pwsh
30+
run: |
31+
$Config = (Get-Content '.github/workflow-config.json' | ConvertFrom-Json).AutoPublish
32+
"EnableAutoPublish=$("$($Config.EnableAutoPublish)".ToLower())" >> $Env:GITHUB_OUTPUT
33+
"EnableAutoMerge=$("$($Config.EnableAutoMerge)".ToLower())" >> $Env:GITHUB_OUTPUT
34+
1835
auto-publish:
1936
if: github.repository_owner == 'MicrosoftDocs' && contains(github.event.repository.topics, 'build')
37+
needs: config
2038
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoPublishV2.yml@workflows-prod
2139
with:
2240
PayloadJson: ${{ toJSON(github) }}
23-
EnableAutoPublish: true
24-
EnableAutoMerge: true
25-
41+
EnableAutoPublish: ${{ fromJSON(needs.config.outputs.EnableAutoPublish) }}
42+
EnableAutoMerge: ${{ fromJSON(needs.config.outputs.EnableAutoMerge) }}
2643
secrets:
2744
AccessToken: ${{ secrets.GITHUB_TOKEN }}
2845
PrivateKey: ${{ secrets.M365_APP_PRIVATE_KEY }}
29-
ClientId: ${{ secrets.M365_APP_CLIENT_ID }}
46+
ClientId: ${{ secrets.M365_APP_CLIENT_ID }}

.github/workflows/TierManagement.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,31 @@ on:
1313

1414
jobs:
1515

16+
config:
17+
if: github.repository_owner == 'MicrosoftDocs' && github.repository_visibility == 'private'
18+
runs-on: ubuntu-latest
19+
outputs:
20+
EnableWriteSignOff: ${{ steps.read.outputs.EnableWriteSignOff }}
21+
EnableReadOnlySignoff: ${{ steps.read.outputs.EnableReadOnlySignoff }}
22+
steps:
23+
- uses: actions/checkout@v5
24+
with:
25+
sparse-checkout: .github/workflow-config.json
26+
sparse-checkout-cone-mode: false
27+
- id: read
28+
shell: pwsh
29+
run: |
30+
$Config = (Get-Content '.github/workflow-config.json' | ConvertFrom-Json).TierManagement
31+
"EnableWriteSignOff=$($Config.EnableWriteSignOff)" >> $Env:GITHUB_OUTPUT
32+
"EnableReadOnlySignoff=$($Config.EnableReadOnlySignoff)" >> $Env:GITHUB_OUTPUT
33+
1634
tier-mgmt:
1735
if: github.repository_owner == 'MicrosoftDocs' && github.repository_visibility == 'private'
36+
needs: config
1837
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-TierManagement.yml@workflows-prod
1938
with:
2039
PayloadJson: ${{ toJSON(github) }}
21-
EnableWriteSignOff: 1
22-
EnableReadOnlySignoff: 1
40+
EnableWriteSignOff: ${{ fromJSON(needs.config.outputs.EnableWriteSignOff) }}
41+
EnableReadOnlySignoff: ${{ fromJSON(needs.config.outputs.EnableReadOnlySignoff) }}
2342
secrets:
2443
AccessToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)