Skip to content

Commit

Permalink
Building from source, use actions checkout which simplifies things an…
Browse files Browse the repository at this point in the history
…d doesn't require source be in the test repository
  • Loading branch information
JimSuplizio committed Mar 14, 2023
1 parent 4c5dc05 commit ab62fad
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 98 deletions.
42 changes: 23 additions & 19 deletions tools/github-event-processor/YmlAndConfigFiles/event-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,32 @@ jobs:
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20230303.6
--version 1.0.0-dev.20230313.4
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
# End-Install

# Testing checkout of sources from the Azure/azure-sdk-tools repository
# The ref: is the SHA from the pull request in that repository or the
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
# need to point to that fork
# Start-Build
# - name: Checkout tools repo for GitHub Event Processor sources
# uses: actions/checkout@v3
# with:
# repository: Azure/azure-sdk-tools
# path: azure-sdk-tools
# ref: <refs/pull/<PRNumber>/merge> or <sha>

# - name: Build and install GitHubEventProcessor from sources
# run: |
# dotnet pack
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
# shell: bash
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# End-Build

- name: Process Action Event
run: |
Expand All @@ -75,21 +97,3 @@ jobs:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }}
# End-Install

# To run github-event-processor built from source, for testing purposes, uncomment this
# step and comment the two steps above this.
# Start-Build From Source
# - name: Process Action Event - Built from source
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# # This is a temporary secret generated by github
# # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }}
# End-Build From Source
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
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 @@ -35,18 +36,39 @@ jobs:
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20230303.6
--version 1.0.0-dev.20230313.4
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
# End-Install

# Testing checkout of sources from the Azure/azure-sdk-tools repository
# The ref: is the SHA from the pull request in that repository or the
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
# need to point to that fork
# Start-Build
# - name: Checkout tools repo for GitHub Event Processor sources
# uses: actions/checkout@v3
# with:
# repository: Azure/azure-sdk-tools
# path: azure-sdk-tools
# ref: <refs/pull/<PRNumber>/merge> or <sha>

# - name: Build and install GitHubEventProcessor from sources
# run: |
# dotnet pack
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
# shell: bash
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# End-Build

- name: Close Stale Issues Scheduled Event
if: github.event.schedule == '0 1 * * *'
run: |
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json CloseStaleIssues
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -57,7 +79,6 @@ jobs:
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json IdentifyStalePullRequests
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -68,7 +89,6 @@ jobs:
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json CloseStalePullRequests
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -79,7 +99,6 @@ jobs:
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json IdentifyStaleIssues
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -90,7 +109,6 @@ jobs:
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json CloseAddressedIssues
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -101,79 +119,6 @@ jobs:
echo $GITHUB_PAYLOAD > payload.json
github-event-processor ${{ github.event_name }} payload.json LockClosedIssues
shell: bash
working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
env:
GITHUB_PAYLOAD: ${{ toJson(github.event) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# End-Install

# 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
# Start-Build From Source
# - name: Close Stale Issues Scheduled Event - Built from source
# if: github.event.schedule == '0 1 * * *'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json CloseStaleIssues
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Identify Stale PullRequests Scheduled Event - Built from source
# if: github.event.schedule == '0 5 * * FRI'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json IdentifyStalePullRequests
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Close Stale PullRequests Scheduled Event - Built from source
# if: github.event.schedule == '30 2,8,14,20 * * *'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json CloseStalePullRequests
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Identify Stale Issues Scheduled Event - Built from source
# if: github.event.schedule == '30 3,9,15,21 * * *'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json IdentifyStaleIssues
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Close Addressed Issues Scheduled Event - Built from source
# if: github.event.schedule == '30 4,10,16,22 * * *'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json CloseAddressedIssues
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Lock Closed Issues Scheduled Event - Built from source
# if: github.event.schedule == '30 5,11,17,23 * * *'
# run: |
# echo $GITHUB_PAYLOAD > payload.json
# dotnet run -- ${{ github.event_name }} payload.json LockClosedIssues
# shell: bash
# working-directory: tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# env:
# GITHUB_PAYLOAD: ${{ toJson(github.event) }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# End-Build From Source

0 comments on commit ab62fad

Please sign in to comment.