Skip to content

Commit

Permalink
Update sample yml (#7809)
Browse files Browse the repository at this point in the history
* Update sample yml

* Add exclude to trigger and adjust spacing
  • Loading branch information
JimSuplizio authored Mar 4, 2024
1 parent f39704f commit 0489973
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand All @@ -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
Expand All @@ -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

Expand All @@ -56,7 +54,7 @@ jobs:
# with:
# repository: Azure/azure-sdk-tools
# path: azure-sdk-tools
# ref: <refs/pull/<PRNumber>/merge> or <sha> or <branch>
# ref: <refs/pull/<PRNumber>/merge> or <sha>

# - name: Build and install GitHubEventProcessor from sources
# run: |
Expand All @@ -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 }}
6 changes: 6 additions & 0 deletions tools/github-event-processor/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 0489973

Please sign in to comment.