Skip to content

Commit 6779c55

Browse files
committed
Verify download
1 parent 12f2e18 commit 6779c55

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/update.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@ jobs:
2626
env:
2727
GH_TOKEN: ${{ github.token }}
2828

29-
- name: Update version string
29+
- name: Get digest
30+
id: digest
31+
run: |
32+
{
33+
echo -n 'digest='
34+
gh api repos/bitwarden/clients/releases/tags/cli-v${{ steps.version.outputs.version }} -q '.assets[] | select(name | startswith("bw-oss-linux")) | .digest | split(":") | last'
35+
} >> "$GITHUB_OUTPUT"
36+
37+
- name: Update version and digest
3038
run: |
3139
sed -Ei 's/(BW_VERSION=)[0-9.]+/\1${{ steps.version.outputs.version }}/' Dockerfile
40+
sed -Ei 's/(BW_DIGEST=)[a-f0-9]+/\1${{ steps.digest.outputs.version }}/' Dockerfile
3241
3342
- name: Create pull request
3443
uses: peter-evans/create-pull-request@v7

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM debian:13.2-slim
22

33
ARG BW_VERSION=2025.11.0
4+
ARG BW_DIGEST=abc
45
ENV DEBIAN_FRONTEND=noninteractive
56

67
# install bitwarden-cli
@@ -10,6 +11,7 @@ RUN <<EOF
1011
apt-get clean
1112
rm -rf /var/lib/apt/lists/*
1213
wget --no-verbose "https://github.com/bitwarden/clients/releases/download/cli-v${BW_VERSION}/bw-oss-linux-${BW_VERSION}.zip"
14+
sha256sum -c - <<< "$BW_DIGEST bw-oss-linux-${BW_VERSION}.zip"
1315
unzip "bw-oss-linux-${BW_VERSION}.zip"
1416
rm -fv "bw-oss-linux-${BW_VERSION}.zip"
1517
mv bw /usr/local/bin/

0 commit comments

Comments
 (0)