Skip to content

Commit

Permalink
chore(IDX): use env -u to unset env var (#3831)
Browse files Browse the repository at this point in the history
This uses `env` to modify the command's environment instead of handling
this in bash with a temporary variable:

```sh
$ export FOO=hello
$ export BAR=world
$ printenv FOO BAR
hello
world
$ env -u BAR printenv FOO BAR
hello
```
  • Loading branch information
nmattia authored Feb 6, 2025
1 parent b24f181 commit 83f9978
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/actions/bazel-test-all/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,11 @@ runs:
echo -e "Host *\nUser github-runner\n" > ~/.ssh/config
fi
# unset honeycomb api key but use it latter for exporter
# unset honeycomb api key but use it later for exporter
# TODO: remove exporter when users can use superset
KEY=${BUILDEVENT_APIKEY:-""}
unset BUILDEVENT_APIKEY
${GITHUB_WORKSPACE}/ci/bazel-scripts/main.sh
env -u BUILDEVENT_APIKEY ${GITHUB_WORKSPACE}/ci/bazel-scripts/main.sh
BAZEL_EXIT_CODE="$?"
export BUILDEVENT_APIKEY="$KEY"
if [ -n "$BUILDEVENT_APIKEY" ] && [ -f ./bazel-bep.pb ]; then
# avoid output unless an error occurs during bes export. This ensures
# only the (more relevant) output from the main bazel command is shown.
Expand Down

0 comments on commit 83f9978

Please sign in to comment.