GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: add action to update base image (#33) · hypertrace/docker-java-base@132439e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • update-docker-args.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/update-docker-args.yml‎

Copy file name to clipboard
+58Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update Docker Args
2+
on:
3+
schedule:
4+
- cron: 0 1 * * 1
5+
workflow_dispatch:
6+
jobs:
7+
update-docker-args:
8+
runs-on: ubuntu-22.04
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Update Docker Args
17+
shell: bash
18+
id: args
19+
run: |
20+
BASE_IMAGE="gcr.io/distroless/cc-debian12"
21+
BASE_IMAGE_TAG="debug"
22+
BASE_IMAGE_DIGEST=$(gcloud container images list-tags $BASE_IMAGE --format json | jq --arg tag "$BASE_IMAGE_TAG" -r '.[] | {digest: .digest, tag: .tags[]} | select(.tag == $tag) | .digest')
23+
if [ -n "$BASE_IMAGE_DIGEST" ]; then
24+
echo -n "${BASE_IMAGE}:${BASE_IMAGE_TAG}@${BASE_IMAGE_DIGEST}" > java-11/base.image
25+
echo -n "${BASE_IMAGE}:${BASE_IMAGE_TAG}@${BASE_IMAGE_DIGEST}" > java-21/base.image
26+
echo "digest=${BASE_IMAGE_DIGEST}" >> $GITHUB_OUTPUT
27+
else
28+
echo "digest=null" >> $GITHUB_OUTPUT
29+
fi
30+
31+
- name: Create Pull Request
32+
if: steps.args.outputs.digest != 'null'
33+
uses: peter-evans/create-pull-request@v6
34+
id: create-pull-request
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
title: Update docker args (Automated)
38+
body: |
39+
# Autogenerated docker args update:
40+
digest: ${{ steps.args.outputs.digest }}
41+
commit-message: Update docker args
42+
delete-branch: true
43+
branch-suffix: timestamp
44+
45+
- name: Enable Pull Request Automerge
46+
if: steps.args.outputs.digest != 'null'
47+
uses: peter-evans/enable-pull-request-automerge@v3
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}
51+
merge-method: squash
52+
53+
# - name: Approve Pull Request
54+
# if: steps.args.outputs.digest != 'null'
55+
# uses: juliangruber/approve-pull-request-action@v2
56+
# with:
57+
# github-token: ${{ secrets.GITHUB_TOKEN }}
58+
# number: ${{ steps.create-pull-request.outputs.pull-request-number }}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.