diff --git a/.github/workflows/AutoIssueAssign.yml b/.github/workflows/AutoIssueAssign.yml index ba72171a7..93710eed8 100644 --- a/.github/workflows/AutoIssueAssign.yml +++ b/.github/workflows/AutoIssueAssign.yml @@ -1,25 +1,42 @@ name: (Scheduled) Auto issue assign permissions: + contents: read issues: write on: schedule: - - cron: "0 17 * * *" + - cron: "26 21 * * *" workflow_dispatch: jobs: + config: + if: github.repository_owner == 'MicrosoftDocs' + runs-on: ubuntu-latest + outputs: + ExcludedUserList: ${{ steps.read.outputs.ExcludedUserList }} + 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).AutoIssueAssign + "ExcludedUserList=$($Config.ExcludedUserList | ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT + stale-branch: if: github.repository_owner == 'MicrosoftDocs' + needs: config uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-AutoIssueAssign.yml@workflows-prod with: PayloadJson: ${{ toJSON(github) }} - ExcludedUserList: '["user1", "user2"]' - + ExcludedUserList: ${{ needs.config.outputs.ExcludedUserList }} secrets: AccessToken: ${{ secrets.GITHUB_TOKEN }} PrivateKey: ${{ secrets.M365_APP_PRIVATE_KEY }} - ClientId: ${{ secrets.M365_APP_CLIENT_ID }} \ No newline at end of file + ClientId: ${{ secrets.M365_APP_CLIENT_ID }} diff --git a/.github/workflows/Stale.yml b/.github/workflows/Stale.yml index 7f262d325..1afccc1eb 100644 --- a/.github/workflows/Stale.yml +++ b/.github/workflows/Stale.yml @@ -1,6 +1,7 @@ name: (Scheduled) Mark stale pull requests permissions: + contents: read issues: write pull-requests: write @@ -10,11 +11,28 @@ on: workflow_dispatch: jobs: + config: + if: github.repository_owner == 'MicrosoftDocs' + runs-on: ubuntu-latest + outputs: + RunDebug: ${{ steps.read.outputs.RunDebug }} + 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).Stale + "RunDebug=$("$($Config.RunDebug)".ToLower())" >> $Env:GITHUB_OUTPUT + stale: if: github.repository_owner == 'MicrosoftDocs' + needs: config uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-Stale.yml@workflows-prod with: - RunDebug: false + RunDebug: ${{ fromJSON(needs.config.outputs.RunDebug) }} RepoVisibility: ${{ github.repository_visibility }} secrets: AccessToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/StaleBranch.yml b/.github/workflows/StaleBranch.yml index 30212d183..ddfe27bd6 100644 --- a/.github/workflows/StaleBranch.yml +++ b/.github/workflows/StaleBranch.yml @@ -18,15 +18,31 @@ on: jobs: + config: + if: github.repository_owner == 'MicrosoftDocs' + runs-on: ubuntu-latest + outputs: + RepoBranchSkipList: ${{ steps.read.outputs.RepoBranchSkipList }} + ReportOnly: ${{ steps.read.outputs.ReportOnly }} + 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).StaleBranch + "RepoBranchSkipList=$($Config.RepoBranchSkipList | ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT + "ReportOnly=$("$($Config.ReportOnly)".ToLower())" >> $Env:GITHUB_OUTPUT + stale-branch: if: github.repository_owner == 'MicrosoftDocs' + needs: config uses: MicrosoftDocs/microsoft-365-docs/.github/workflows/Shared-StaleBranch.yml@workflows-prod with: PayloadJson: ${{ toJSON(github) }} - RepoBranchSkipList: '[ - "ExampleBranch1", - "ExampleBranch2" - ]' - ReportOnly: false + RepoBranchSkipList: ${{ needs.config.outputs.RepoBranchSkipList }} + ReportOnly: ${{ fromJSON(needs.config.outputs.ReportOnly) }} secrets: AccessToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file