Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sample yml #7809

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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