Skip to content

Commit

Permalink
Update purget test resources to fix the workflow failures
Browse files Browse the repository at this point in the history
Signed-off-by: ytimocin <[email protected]>
  • Loading branch information
ytimocin committed May 10, 2024
1 parent bc43e42 commit fada7c0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/purge-test-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Purge test resources
on:
schedule:
- cron: "30 0,12 * * *"
pull_request:
types: [opened, synchronize, reopened]
branches:
- v*.*
- edge
env:
AZURE_RG_DELETE_LIST_FILE: "az_rg_list.txt"
VALID_RESOURCE_WINDOW: 6*60*60
Expand All @@ -27,7 +32,7 @@ jobs:
current_time=$(date +%s)
hours_ago=$((current_time - ${{ env.VALID_RESOURCE_WINDOW }}))
jq -r '.[] | select(.creationTime == null || .creationTime < '$hours_ago') | .Name' resource_groups.json > ${{ env.AZURE_RG_DELETE_LIST_FILE}}
jq -r ".[] | select(.creationTime == null || .creationTime < \"$hours_ago\") | .Name" resource_groups.json > ${{ env.AZURE_RG_DELETE_LIST_FILE}}
jq -r '.[] | {name: .Name, creationTime: .creationTime // "None"}' resource_groups.json > $GITHUB_STEP_SUMMARY
- name: Delete Azure Resource Groups
Expand All @@ -42,6 +47,6 @@ jobs:
- name: Create GitHub issue on failure
if: ${{ failure() }}
run: |
gh issue create --title "Samples purge test resources failed \
gh issue create --title "Samples purge test resources failed" \
--body "Test failed on ${{ github.repository }}. See [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details." \
s--repo ${{ github.repository }}
--repo ${{ github.repository }}

0 comments on commit fada7c0

Please sign in to comment.