Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Use $GITHUB_EVENT_PATH variable instead of inline file writing
  • Loading branch information
benbp authored and azure-sdk committed Oct 10, 2024
commit d85a944ea4b153c038ba8127d88bc5a96db33c28
10 changes: 2 additions & 8 deletions .github/workflows/event-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ jobs:

- name: Process Action Event
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH
shell: bash
env:
# This is a temporary secret generated by github
Expand Down Expand Up @@ -143,10 +140,7 @@ jobs:

- name: Process Action Event
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH
shell: bash
env:
# This is a temporary secret generated by github
Expand Down
35 changes: 7 additions & 28 deletions .github/workflows/scheduled-event-processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,76 +69,55 @@ jobs:
- name: Close Stale Issues Scheduled Event
if: github.event.schedule == '0 1 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseStaleIssues
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH CloseStaleIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Identify Stale PullRequests Scheduled Event
if: github.event.schedule == '0 5 * * FRI'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json IdentifyStalePullRequests
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH IdentifyStalePullRequests
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Close Stale PullRequests Scheduled Event
if: github.event.schedule == '30 2,8,14,20 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseStalePullRequests
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH CloseStalePullRequests
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Identify Stale Issues Scheduled Event
if: github.event.schedule == '30 3,9,15,21 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json IdentifyStaleIssues
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH IdentifyStaleIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Close Addressed Issues Scheduled Event
if: github.event.schedule == '30 4,10,16,22 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseAddressedIssues
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lock Closed Issues Scheduled Event
if: github.event.schedule == '30 5,11,17,23 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json LockClosedIssues
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH LockClosedIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enforce Max Life of Issues Scheduled Event
if: github.event.schedule == '0 18 * * 1,3,5'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json EnforceMaxLifeOfIssues
github-event-processor ${{ github.event_name }} $GITHUB_EVENT_PATH EnforceMaxLifeOfIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}