Skip to content

Commit a955ccb

Browse files
committed
new workflow
1 parent 3822e0e commit a955ccb

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

.github/workflows/docker.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ jobs:
7272
LOCAL_SEMVER_PATCH=$(awk -F. '{ print $3 }' <<< ${json_semver_version})
7373
LOCAL_SEMVER_PREFIX=""
7474
LOCAL_SEMVER_SUFFIX=""
75+
LOCAL_SEMVER_RC=""
7576
LOCAL_TAGS="${LOCAL_IMAGE}:${LOCAL_SHA}"
7677
if [ ! -z ${input_semverprefix} ]; then LOCAL_SEMVER_PREFIX="${input_semverprefix}-"; fi
7778
if [ ! -z ${input_semversuffix} ]; then LOCAL_SEMVER_SUFFIX="-${input_semversuffix}"; fi
79+
if [ ! -z ${json_semver_rc} ]; then LOCAL_SEMVER_RC="-${json_semver_rc}"; fi
7880
if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}${LOCAL_SEMVER_SUFFIX}"; fi
7981
if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}${LOCAL_SEMVER_SUFFIX}"; fi
8082
if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}${LOCAL_SEMVER_SUFFIX}"; fi
@@ -87,10 +89,10 @@ jobs:
8789
if [ ! -z ${input_uid} ]; then echo "IMAGE_UID=${input_uid}" >> $GITHUB_ENV; else echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV; fi
8890
if [ ! -z ${input_gid} ]; then echo "IMAGE_GID=${input_gid}" >> $GITHUB_ENV; else echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV; fi
8991
90-
: # set prefix or suffix globally
92+
: # set rc, prefix or suffix globally
9193
echo "IMAGE_SEMVER_PREFIX=${LOCAL_SEMVER_PREFIX}" >> $GITHUB_ENV
9294
echo "IMAGE_SEMVER_SUFFIX=${LOCAL_SEMVER_SUFFIX}" >> $GITHUB_ENV
93-
95+
echo "IMAGE_VERSION_RC=${LOCAL_SEMVER_RC}" >> $GITHUB_ENV
9496
9597
- name: docker / login to hub
9698
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
@@ -104,7 +106,8 @@ jobs:
104106
- name: docker / setup buildx
105107
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
106108

107-
- name: grype / build & push
109+
- name: grype / build & push & tag
110+
id: grype-tag
108111
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
109112
with:
110113
context: .
@@ -122,23 +125,31 @@ jobs:
122125
APP_GID=${{ env.IMAGE_GID }}
123126
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
124127
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
128+
APP_VERSION_RC=${{ env.IMAGE_VERSION_RC }}
125129
APP_NO_CACHE=$(date +%s)
126130
tags: |
127131
${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
128132
129133
- name: grype / scan
130-
id: scan
134+
id: grype-scan
131135
uses: anchore/scan-action@abae793926ec39a78ab18002bc7fc45bbbd94342
132136
with:
133137
image: ${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
134138
severity-cutoff: ${{ env.WORKFLOW_GRYPE_SEVERITY_CUTOFF }}
139+
by-cve: true
140+
output-format: 'sarif'
141+
output-file: ${{ runner.temp }}/_github_home/grype.sarif
135142

136-
- name: grype / report / print
143+
- name: grype / report / sarif to markdown
144+
id: sarif-to-md
137145
if: success() || failure()
138-
run: cat ${{ steps.scan.outputs.sarif }}
146+
continue-on-error: true
147+
uses: 11notes/action-sarif-to-markdown@b2656b3171cb3cddc50d50b2f86921cb2e6aeab1
148+
with:
149+
sarif_file: grype.sarif
139150

140151
- name: grype / delete tag
141-
if: success() || failure()
152+
if: steps.grype-tag.outcome == 'success'
142153
run: |
143154
curl --request DELETE \
144155
--url https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/tags/${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}/ \
@@ -147,9 +158,11 @@ jobs:
147158
--fail
148159
149160
- name: grype / report / upload
161+
if: steps.grype-scan.outcome == 'success'
150162
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
151163
with:
152-
sarif_file: ${{ steps.scan.outputs.sarif }}
164+
sarif_file: ${{ steps.grype-scan.outputs.sarif }}
165+
category: grype
153166

154167
- name: docker / build & push
155168
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
@@ -171,6 +184,7 @@ jobs:
171184
APP_GID=${{ env.IMAGE_GID }}
172185
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
173186
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
187+
APP_VERSION_RC=${{ env.IMAGE_VERSION_RC }}
174188
APP_NO_CACHE=$(date +%s)
175189
tags: |
176190
${{ env.IMAGE_TAGS }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ These are the main tags for the image. There is also a tag for each commit and i
1717
* [stable-unraid](https://hub.docker.com/r/11notes/kms-gui/tags?name=stable-unraid)
1818
* [latest-unraid](https://hub.docker.com/r/11notes/kms-gui/tags?name=latest-unraid)
1919

20+
2021
# SYNOPSIS 📖
2122
**What can I do with this?** This image will run a web GUI for your [11notes/kms](https://hub.docker.com/r/11notes/kms) server.
2223

@@ -67,6 +68,7 @@ volumes:
6768
# GENERAL TIPS 📌
6869
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
6970
* Use Let’s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
70-
71+
72+
7173
# ElevenNotes™️
7274
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-kms-gui/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-kms-gui/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-kms-gui/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories).

0 commit comments

Comments
 (0)