-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (29 loc) · 1.18 KB
/
docker-cleanup.yml
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
name: Docker Cleanup
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const issue_number = context.payload.pull_request?.number;
const package_version_id = `pr-${issue_number}`;
const images = [
`haddock3-webapp`,
`bartender`,
`certmaker`
];
let message = 'Please delete the images belonging to this Pull Request as they are no longer useful.\n\n';
for (const image of images) {
message += `- [ghcr.io/i-vresse/${image}](https://github.com/i-VRESSE/haddock3-webapp/pkgs/container/${image}/versions)\n`;
}
message += `\nGoto versions page of each image, find version called ${package_version_id}, filter on tagged versions by clicking "N tagged" button in table header, click on **...** button and select **Delete version**.\n`;
await github.rest.issues.createComment({
issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
});