Skip to content

validator and workflow to test GH actions permissions #1

validator and workflow to test GH actions permissions

validator and workflow to test GH actions permissions #1

Workflow file for this run

name: Cleanup PR Images
on:
pull_request:
types: [closed]
env:
# github.repository as <account>/<repo>/<image_name>
# github.repository will need to be split to get the correct image name
# so we must drop the "GITHUB_REPOSITORY_OWNER/" prefex
IMAGE_NAME: ${{ github.repository }}/cloudzero-agent-validator
jobs:
purge-image:
name: Delete image from ghcr.io
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: drop owner from IMAGE_NAME name for delete
run: |
# trim off the "GITHUB_REPOSITORY_OWNER/" prefix
IMAGE_NAME=${IMAGE_NAME#*/}
echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
- name: Delete image
uses: bots-house/[email protected]
with:
owner: cloudzero
name: ${{ env.IMAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: pr-${{github.event.pull_request.number}}