Skip to content

Commit

Permalink
Adding packages:write permission to the purge test resources workflow
Browse files Browse the repository at this point in the history
Signed-off-by: ytimocin <[email protected]>
  • Loading branch information
ytimocin committed Jul 29, 2024
1 parent 594faf6 commit 5ebb24e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/purge-test-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ name: Purge test resources
permissions:
id-token: write # Required for requesting the JWT
contents: read # Required for actions/checkout
packages: write # Required for reading package versions and deleting packages

on:
# Enable manual trigger
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:
org-name: radius-project
token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
keep-at-least: 1

purge_azure_resources:
name: Azure resources clean-ups
runs-on: ubuntu-latest
Expand All @@ -62,6 +64,7 @@ jobs:
client-id: ${{ secrets.AZURE_SP_TESTS_APPID }}
tenant-id: ${{ secrets.AZURE_SP_TESTS_TENANTID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTIONID_TESTS }}

- name: Find old test resource groups
run: |
echo "## Test resource group list" >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -93,14 +96,16 @@ jobs:
echo " * :white_check_mark: $name - creationTime: $creation_time" >> $GITHUB_STEP_SUMMARY
fi
done <<< "$resource_groups"
- name: Delete Azure resource groups
run: |
echo "## Deleting resource group list" >> $GITHUB_STEP_SUMMARY
cat ${{ env.AZURE_RG_DELETE_LIST_FILE}} | while read line
do
echo " * $line" >> $GITHUB_STEP_SUMMARY
az group delete --resource-group $line --yes --verbose --no-wait
az group delete --resource-group $line --yes --verbose
done
create_issue_on_failure:
name: Create issue for failing purge test resources run
needs: [purge_ghcr_dev, purge_azure_resources]
Expand Down

0 comments on commit 5ebb24e

Please sign in to comment.