-
Notifications
You must be signed in to change notification settings - Fork 196
46 lines (40 loc) · 1.8 KB
/
AutoPublish.yml
File metadata and controls
46 lines (40 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: (Scheduled) Publish to live
permissions:
contents: write
pull-requests: write
checks: read
on:
schedule:
- cron: "25 2,5,8,11,14,17,20,22 * * *" # Times are UTC based on Daylight Saving Time (~Mar-Nov). Scheduling at :25 to account for queuing lag.
# - cron: "25 3,6,9,12,15,18,21,23 * * *" # Times are UTC based on Standard Time (~Nov-Mar). Scheduling at :25 to account for queuing lag.
workflow_dispatch:
jobs:
config:
if: github.repository_owner == 'MicrosoftDocs' && contains(github.event.repository.topics, 'build')
runs-on: ubuntu-latest
outputs:
EnableAutoPublish: ${{ steps.read.outputs.EnableAutoPublish }}
EnableAutoMerge: ${{ steps.read.outputs.EnableAutoMerge }}
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: .github/workflow-config.json
sparse-checkout-cone-mode: false
- id: read
shell: pwsh
run: |
$Config = (Get-Content '.github/workflow-config.json' | ConvertFrom-Json).AutoPublish
"EnableAutoPublish=$("$($Config.EnableAutoPublish)".ToLower())" >> $Env:GITHUB_OUTPUT
"EnableAutoMerge=$("$($Config.EnableAutoMerge)".ToLower())" >> $Env:GITHUB_OUTPUT
auto-publish:
if: github.repository_owner == 'MicrosoftDocs' && contains(github.event.repository.topics, 'build')
needs: config
uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoPublishV2.yml@workflows-prod
with:
PayloadJson: ${{ toJSON(github) }}
EnableAutoPublish: ${{ fromJSON(needs.config.outputs.EnableAutoPublish) }}
EnableAutoMerge: ${{ fromJSON(needs.config.outputs.EnableAutoMerge) }}
secrets:
AccessToken: ${{ secrets.GITHUB_TOKEN }}
PrivateKey: ${{ secrets.M365_APP_PRIVATE_KEY }}
ClientId: ${{ secrets.M365_APP_CLIENT_ID }}