Skip to content

robot updated golang version #88

robot updated golang version

robot updated golang version #88

name: Clean Image CI By PR
# cleaner for ghcr image , when PR is closed
env:
ONLINE_REGISTER: ghcr.io
on:
pull_request:
types: [closed]
permissions: write-all
jobs:
purge-image:
name: Delete image from ghcr.io
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: spiderpool-agent
- name: spiderpool-controller
steps:
# commit sha is used for image tag
- name: Getting image tag
id: tag
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo "tag=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "tag=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Delete CI image
uses: vlaurin/[email protected]
with:
token: ${{ secrets.WELAN_PAT }}
organization: ${{ github.repository_owner }}
container: ${{ env.ONLINE_REGISTER }}/${{ github.repository }}/${{ matrix.name }}-ci
# Dry-run first, then change to `false`
dry-run: false
# Minimum age in days of a version before it is pruned. Defaults to 0 which matches all versions of a container
older-than: 0
# Count of most recent, matching containers to exclude from pruning
keep-last: 0
# untagged versions should be pruned
untagged: true
# if no tag-regex , all tag will be pruned
tag-regex: "${{ env.tag }}"