-
Notifications
You must be signed in to change notification settings - Fork 7
33 lines (29 loc) · 1000 Bytes
/
pr-cleanup.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
name: 'Clean up Docker images from PR'
on:
pull_request:
types: [closed]
jobs:
purge-image:
name: Delete image from ghcr.io
runs-on: ubuntu-latest
steps:
- name: Build PR Check
id: containers
run: |
if [[ "${{ secrets.BUILD_PR }}" != "" && \
"${{ secrets.PR_CONTAINERS_USER }}" != "" && \
"${{ secrets.PR_CONTAINERS }}" != "" ]]
then
echo "PR Builds configured"
echo "::set-output name=BUILD_PR::true"
else
echo "PR Builds not configured"
echo "::set-output name=BUILD_PR::false"
fi
- uses: chipkent/action-cleanup-package@v1.0.3
with:
package-name: ${{ github.event.repository.name }}
tag: pr-${{ github.event.pull_request.number }}
github-token: ${{ secrets.PR_CONTAINERS }}
github-org: ${{ secrets.ORG}} # Should only be set when running in an organization
if: ${{ fromJSON(steps.containers.outputs.BUILD_PR) }}