-
Notifications
You must be signed in to change notification settings - Fork 155
37 lines (34 loc) · 1.15 KB
/
withdraw-images.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
default: 'true'
description: If true, just log
permissions:
contents: read
jobs:
withdraw:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: chainguard-dev/setup-chainctl@598499528905f95b94e62e4831cf42035e768933 # v0.2.3
with:
identity: 720909c9f5279097d847ad02a2f24ba8f59de36a/b6461e99e132298f
- uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- run: |
for img in $(grep -v '\#' withdrawn-images.txt); do
if [[ "${{ github.event.inputs.dry_run }}" == "false" ]]; then
crane delete "$img" || true
crane delete "$img-dev" || true
else
echo "DRY RUN: crane delete $img || true"
echo "DRY RUN: crane delete $img-dev || true"
fi
done