You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
907 B
23 lines
907 B
name: Clean build artifacts |
|
on: |
|
schedule: |
|
- cron: '0 10 * * *' # Once per day at 10am UTC |
|
|
|
permissions: |
|
contents: read |
|
|
|
jobs: |
|
main: |
|
runs-on: ubuntu-latest |
|
if: ${{ github.repository == 'spring-projects/spring-security' }} |
|
permissions: |
|
contents: none |
|
steps: |
|
- name: Delete artifacts in cron job |
|
env: |
|
GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} |
|
run: | |
|
echo "Running clean build artifacts logic" |
|
output=$(curl -X GET -H "Authorization: token $GH_ACTIONS_REPO_TOKEN" https://api.github.com/repos/spring-projects/spring-security/actions/artifacts | grep '"id"' | cut -d : -f2 | sed 's/,*$//g') |
|
echo Output is $output |
|
for id in $output; do curl -X DELETE -H "Authorization: token $GH_ACTIONS_REPO_TOKEN" https://api.github.com/repos/spring-projects/spring-security/actions/artifacts/$id; done;
|
|
|