Skip to content

Commit 4800dc4

Browse files
committed
Add missing yaml
1 parent 1bf3bc5 commit 4800dc4

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
name: delete-image-tag.yml
1+
name: Delete PR Image On PR Close Action
2+
23
on:
4+
pull_request_target:
5+
types: [closed]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
issues: write
311

412
jobs:
13+
delete-quay-tag:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Install regctl
17+
run: |
18+
curl -LO https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64
19+
chmod +x regctl-linux-amd64
20+
sudo mv regctl-linux-amd64 /usr/local/bin/regctl
21+
regctl version
22+
23+
- name: Configure regctl authentication
24+
run: |
25+
regctl registry login quay.io -u ${{ secrets.QUAY_USERNAME }} -p ${{ secrets.QUAY_PASSWORD }}
26+
echo "PR number: ${{ github.event.pull_request.number }}"
27+
echo "TAG_TO_DELETE=$(regctl tag ls quay.io/opendatahub/opendatahub-tests --include pr-${{ github.event.pull_request.number }})" >> $GITHUB_ENV
28+
- name: Delete Quay Tag
29+
if: env.TAG_TO_DELETE != ''
30+
run: |
31+
echo "Deleting tag '$TAG_TO_DELETE' from repository..."
32+
regctl tag rm quay.io/opendatahub/opendatahub-tests:pr-${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)