Skip to content

Commit

Permalink
Add image prefix for PRs.
Browse files Browse the repository at this point in the history
Signed-off-by: Mangirdas Judeikis <[email protected]>
 On-behalf-of: @SAP [email protected]
  • Loading branch information
mjudeikis committed Dec 19, 2024
1 parent 7bf8cd5 commit 73882f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/gh-image-purge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Daily Image Cleanup
on:
# every day at 01:30am
schedule:
- cron: '30 1 * * *'
jobs:
- name: ghcr cleanup action
runs-on: ubuntu-latest
steps:
- uses: dataaxiom/ghcr-cleanup-action@v1
with:
older-than: 1 month
owner: kcp-dev
repository: kcp
package: kcp
delete-tags: '^pr-\d+-[a-z0-9]+-[a-z0-9]+$'
use-regex: true
dry-run: true
3 changes: 0 additions & 3 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ presubmits:
- image: quay.io/containers/buildah:v1.30.0
command:
- hack/build-image.sh
env:
- name: DRY_RUN
value: '1'
# docker-in-docker needs privileged mode
securityContext:
privileged: true
Expand Down
6 changes: 3 additions & 3 deletions hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ if [ -n "${PULL_BASE_REF:-}" ]; then
fi
fi

# Prefix with "dev-" if not on a tag or branch
if [ -z "$branchName" ]; then
version="dev-$version"
# Prefix with "pr-" if not on a tag or branch
if [ -n "${PULL_NUMBER:-}" ]; then
version="pr-$PULL_NUMBER-$version"
fi

image="$repository:$version"
Expand Down

0 comments on commit 73882f2

Please sign in to comment.