Skip to content

Commit

Permalink
Add a cleanup action.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Mar 31, 2024
1 parent 05ce99e commit 9288f34
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cleanup-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2024 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
---
name: 'Cleanup testing tags.'

on:
schedule:
- cron: '52 1 * * 1' # Monday at 1:52am UTC clean everything up
workflow_dispatch:

jobs:
remove-tags:
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
token: ${{ secrets.PUSH_TAG_TOKEN }}

- name: Search for v1.x.x or v2.x.x tags to remove
shell: bash
run: |
mapfile -t tags< <(git tag | grep "v[12]\.")
for tag in "${tags[@]}"; do
echo "Removing $tag"
git tag -d $tag
git push origin :refs/tags/$tag
done

0 comments on commit 9288f34

Please sign in to comment.