Skip to content

Commit

Permalink
chore: copy code review improvements from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Mar 19, 2024
1 parent 4b8a63a commit ebb0303
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/mirror_protoc_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
# Trigger manually in the UI
workflow_dispatch:
# Trigger daily at 06:10 UTC
# Note, the create-pull-request action only sends a PR if there's a code change,
# so a no-op execution of the mirror_protoc_releases script on most days will
# not create a pull request.
schedule:
- cron: "10 6 * * *"

Expand Down
4 changes: 4 additions & 0 deletions protoc/private/mirror_protoc_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ map(select(.tag_name == $version))[0]
# Create a file that looks like a checksums.txt from a shasum command, i.e.
# sha384-RVFu8PJJCOSXwYTqH7FyWRSgsP1AAjcEa+VViddVTgtd9wYvZjQoQ8jmlFxwfFw+ protobuf-26.0-rc3.tar.gz
# sha384-JYSXGTSBfwUU6UzqazUTkT3lTZDzx10YdaNQYjojrT7X1Ro1fA+T4tjJw0e8UISV protobuf-26.0-rc3.zip
#
# Note, this follows https://en.wikipedia.org/wiki/Trust_on_first_use
# in that we assume that a release is not tampered for 24h until we mirror it, then afterward
# we are guaranteed that whatever we initially trusted does not change.
CHECKSUMS=$(mktemp)
for url in $(jq --arg version $VERSION --raw-output "$DOWNLOAD_URLS_FILTER" <$RELEASES); do
sha=$(curl -sSL $url | shasum -b -a 384 | awk "{ print \$1 }" | xxd -r -p | base64)
Expand Down

0 comments on commit ebb0303

Please sign in to comment.