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

Adding packages:write permission to the purge test resources workflow #7760

Merged
merged 1 commit into from
Aug 1, 2024
Merged
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
5 changes: 5 additions & 0 deletions .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,6 +96,7 @@ 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
Expand All @@ -101,6 +105,7 @@ jobs:
echo " * $line" >> $GITHUB_STEP_SUMMARY
az group delete --resource-group $line --yes --verbose --no-wait
sylvainsf marked this conversation as resolved.
Show resolved Hide resolved
done
create_issue_on_failure:
name: Create issue for failing purge test resources run
needs: [purge_ghcr_dev, purge_azure_resources]
Expand Down