Skip to content

github: Add prettier lint step. #7

github: Add prettier lint step.

github: Add prettier lint step. #7

---
name: Cleanup closed PR images
on:
pull_request:
branches:
- main
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- id: get-version-id
name: Get PR image version-id
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION_ID=$(gh api '/orgs/zulip/packages/container/docker-zulip/versions' | jq '.[] | select(.metadata.container.tags | any(index("pr-${{github.event.pull_request.number }}"))) | .id')
echo "VERSION_ID=$VERSION_ID" >> $GITHUB_OUTPUT
- name: Delete PR image
uses: actions/delete-package-versions@v5
if: steps.get-version-id.outputs.VERSION_ID != ''
with:
package-name: "docker-zulip"
package-type: "container"
package-version-ids: ${{ steps.get-version-id.outputs.VERSION_ID }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Delete untagged images from GHCR
uses: actions/delete-package-versions@v5
with:
package-name: "docker-zulip"
package-type: "container"
min-versions-to-keep: 0
delete-only-untagged-versions: true
token: ${{ secrets.GITHUB_TOKEN }}