Skip to content

Commit

Permalink
Merge branch 'master' into migrate-to-mailpit
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus committed Oct 22, 2024
2 parents 58009c5 + 29da739 commit 52b5f6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: labeler

on:
pull_request:
pull_request_target:
types: ['opened', 'ready_for_review', 'reopened', 'synchronize']

jobs:
Expand All @@ -14,11 +13,18 @@ jobs:
name: Label the PR size
steps:
- uses: actions/checkout@v4
with:
with: # checkout the base branch, where we run the script from
path: base
- uses: actions/checkout@v4
with: # checkout the merge commit, where the PR changes are
ref: refs/pull/${{ github.event.number }}/merge
path: merge
# we need full history
fetch-depth: 0
- name: Run labeler script
- name: Run labeler script from base
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
FAIL_IF_XL: '1'
run: ./devtools/scripts/github-set-pr-label.sh
MAIN_BRANCH: ${{ github.event.pull_request.base.ref }}
run: cd merge && ../base/devtools/scripts/github-set-pr-label.sh
2 changes: 1 addition & 1 deletion alert/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ func (s *Store) Feedback(ctx context.Context, alertIDs []int) ([]Feedback, error
return nil, err
}

ids := make([]int32, len(alertIDs))
ids := make([]int32, 0, len(alertIDs))
for _, id := range alertIDs {
ids = append(ids, int32(id))
}
Expand Down
3 changes: 2 additions & 1 deletion devtools/scripts/github-set-pr-label.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if [ -z "PR_NUMBER" ]; then
exit 1
fi

LABEL=$(./devtools/scripts/git-diff-label-calc.sh --debug)
MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LABEL=$("$MY_DIR/git-diff-label-calc.sh" --debug)

# Remove any existing test/* labels
for label in $(gh pr view "$PR_NUMBER" --json labels --jq '.labels[] | select(.name | startswith("size/")) | .name'); do
Expand Down

0 comments on commit 52b5f6a

Please sign in to comment.