Skip to content

Commit

Permalink
Cached labels incorporate short rev
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Dec 12, 2023
1 parent 345b38b commit a97c053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/current-pr-labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ merge_labels() {

cachedir=target/github
mkdir -p "$cachedir"
rev="$(git rev-parse --short @)"

if [ -n "$GITHUB_EVENT_PATH" ]; then
pr_number="$(jq --raw-output '.pull_request.number // ""' "$GITHUB_EVENT_PATH")"
if [ -n "$pr_number" ]; then
cache="$cachedir/guardrail-ci-${pr_number}-${module_name}-labels-cache.json"
else
cache="$cachedir/guardrail-ci-HEAD-${module_name}-labels-cache.json"
cache="$cachedir/guardrail-ci-${rev}-${module_name}-labels-cache.json"
fi
else
rev="$(git rev-parse --short @)"
cache="$cachedir/guardrail-ci-${rev}-${module_name}-labels-cache.json"
fi

Expand Down

0 comments on commit a97c053

Please sign in to comment.