Skip to content

Upgrade: [dependabot] - bump NHSDigital/eps-common-workflows/.github/… #45

Upgrade: [dependabot] - bump NHSDigital/eps-common-workflows/.github/…

Upgrade: [dependabot] - bump NHSDigital/eps-common-workflows/.github/… #45

name: "Delete old images"
# Controls when the action will run - in this case triggered manually and on schedule
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * 6"
push:
branches: [main]
jobs:
delete-old-pushed-images:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout local code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ env.BRANCH_NAME }}
fetch-depth: 0
- name: delete unused images
shell: bash
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
.github/scripts/delete_unused_images.sh --delete-pr
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
.github/scripts/delete_unused_images.sh --delete-ci --delete-untagged
else
.github/scripts/delete_unused_images.sh
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}