Skip to content

Commit

Permalink
fix: add missing file for release process
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Dec 11, 2021
1 parent 1c5fb63 commit 2dc7954
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/workspace_snippet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail

# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
TAG=${GITHUB_REF_NAME}
TAG_NO_PREFIX=${TAG:1}
SHA=$(git archive --format=tar --prefix=bazel-lib-${TAG_NO_PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')

cat << EOF
WORKSPACE snippet:
\`\`\`starlark

This comment has been minimized.

Copy link
@f0rmiga

f0rmiga Dec 11, 2021

Member

You can avoid escaping the backtick by doing:

cat << "EOF"

This comment has been minimized.

Copy link
@f0rmiga

f0rmiga Dec 11, 2021

Member

Never mind, you need the TAG interpolated.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "aspect_bazel_lib",
sha256 = "${SHA}",
url = "https://github.com/aspect-build/bazel-lib/archive/${TAG}.tar.gz",
)
\`\`\`
EOF

0 comments on commit 2dc7954

Please sign in to comment.