diff --git a/tools/github-event-processor/YmlAndConfigFiles/scheduled-event-processor.yml b/tools/github-event-processor/YmlAndConfigFiles/scheduled-event-processor.yml index 7364383939b..361c959bc82 100644 --- a/tools/github-event-processor/YmlAndConfigFiles/scheduled-event-processor.yml +++ b/tools/github-event-processor/YmlAndConfigFiles/scheduled-event-processor.yml @@ -15,7 +15,8 @@ on: # Lock closed issues, every 6 hours at 05:30 AM, 11:30 AM, 05:30 PM and 11:30 PM - LockClosedIssues - cron: '30 5,11,17,23 * * *' # Enforce max life of issues, every Monday at 10:00 AM - EnforceMaxLifeOfIssues - - cron: '0 10 * * MON' + # Note: GitHub uses UTC, to run at 10am PST, the cron task needs to be 6pm (1800 hours) UTC + - cron: '0 18 * * MON' # This removes all unnecessary permissions, the ones needed will be set below. # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token permissions: {} @@ -28,8 +29,6 @@ jobs: name: Handle ${{ github.event.schedule }} ${{ github.event.action }} event runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - # To run github-event-processor built from source, for testing purposes, uncomment everything # in between the Start/End-Build From Source comments and comment everything in between the # Start/End-Install comments @@ -38,10 +37,9 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20230929.3 + --version 1.0.0-dev.20240229.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global - working-directory: .github/workflows shell: bash # End-Install @@ -56,7 +54,7 @@ jobs: # with: # repository: Azure/azure-sdk-tools # path: azure-sdk-tools - # ref: /merge> or or + # ref: /merge> or # - name: Build and install GitHubEventProcessor from sources # run: | @@ -69,69 +67,76 @@ jobs: - name: Close Stale Issues Scheduled Event if: github.event.schedule == '0 1 * * *' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json CloseStaleIssues shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Identify Stale PullRequests Scheduled Event if: github.event.schedule == '0 5 * * FRI' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json IdentifyStalePullRequests shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Close Stale PullRequests Scheduled Event if: github.event.schedule == '30 2,8,14,20 * * *' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json CloseStalePullRequests shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Identify Stale Issues Scheduled Event if: github.event.schedule == '30 3,9,15,21 * * *' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json IdentifyStaleIssues shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Close Addressed Issues Scheduled Event if: github.event.schedule == '30 4,10,16,22 * * *' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json CloseAddressedIssues shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lock Closed Issues Scheduled Event if: github.event.schedule == '30 5,11,17,23 * * *' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json LockClosedIssues shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Enforce Max Life of Issues Scheduled Event - if: github.event.schedule == '0 10 * * MON' + if: github.event.schedule == '0 18 * * MON' run: | - echo $GITHUB_PAYLOAD > payload.json + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF github-event-processor ${{ github.event_name }} payload.json EnforceMaxLifeOfIssues shell: bash env: - GITHUB_PAYLOAD: ${{ toJson(github.event) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tools/github-event-processor/ci.yml b/tools/github-event-processor/ci.yml index f55e574bdfd..d79e8131f37 100644 --- a/tools/github-event-processor/ci.yml +++ b/tools/github-event-processor/ci.yml @@ -7,6 +7,9 @@ trigger: include: - tools/github-event-processor - tools/codeowners-utils/Azure.Sdk.Tools.CodeownersUtils + exclude: + - tools/github-event-processor/YmlAndConfigFiles + - tools/github-event-processor/*.md pr: branches: @@ -19,6 +22,9 @@ pr: include: - tools/github-event-processor - tools/codeowners-utils/Azure.Sdk.Tools.CodeownersUtils + exclude: + - tools/github-event-processor/YmlAndConfigFiles + - tools/github-event-processor/*.md extends: template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml