-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into PC-7427-validation-for-timeslice-keyword-use…
…d-in-sumo-logic-logs-based-queries
- Loading branch information
Showing
8 changed files
with
242 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name-template: "v$RESOLVED_VERSION" | ||
tag-template: "v$RESOLVED_VERSION" | ||
categories: | ||
- title: ⚠️ Breaking Changes | ||
labels: | ||
- breaking-change | ||
- title: 🚀 Features | ||
labels: | ||
- enhancement | ||
- title: 💻 Fixed Vulnerabilities | ||
labels: | ||
- security | ||
- title: 🐞 Bug Fixes | ||
labels: | ||
- bug | ||
- title: 🧰 Maintenance | ||
collapse-after: 3 | ||
labels: | ||
- chore | ||
- infrastructure | ||
- title: 🤖 Dependency Updates | ||
collapse-after: 3 | ||
labels: | ||
- dependencies | ||
change-template: "- $TITLE (#$NUMBER) @$AUTHOR" | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- major | ||
minor: | ||
labels: | ||
- minor | ||
patch: | ||
labels: | ||
- patch | ||
default: patch | ||
autolabeler: | ||
# Pull requests scope. | ||
- label: enhancement | ||
title: | ||
- "/^feat:/i" | ||
- label: chore | ||
title: | ||
- "/^chore:/i" | ||
- label: infrastructure | ||
title: | ||
- "/^infra:/i" | ||
- label: security | ||
title: | ||
- "/^sec:/i" | ||
- label: bug | ||
title: | ||
- "/^fix:/i" | ||
- label: documentation | ||
title: | ||
- "/^doc:/i" | ||
- label: breaking-change | ||
body: | ||
- '/^## Breaking Changes/im' | ||
- label: release-notes | ||
body: | ||
- '/^## Release Notes/im' | ||
# Version labels. | ||
- label: minor | ||
title: | ||
- "/^feat:/i" | ||
- label: patch | ||
title: | ||
- "/^fix:/i" | ||
- "/^sec:/i" | ||
- "/^chore:/i" | ||
branch: | ||
- '/^renovate_/' | ||
# Languages detection. | ||
- label: go | ||
files: | ||
- '*.go' | ||
- 'go.mod' | ||
- 'go.sum' | ||
- label: python | ||
files: | ||
- '*.py' | ||
- label: javascript | ||
files: | ||
- '*.js' | ||
replacers: | ||
# Remove unlabeled or uncategorized PRs. | ||
- search: "/# What's Changed.*?\\n## /s" | ||
replace: "# What's Changed\n\n## " | ||
template: | | ||
# What's Changed | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Provide a single argument with a version of the release draft to use." >&2 | ||
echo "Usage: $0 <VERSION>" | ||
exit 1 | ||
fi | ||
|
||
VERSION="$1" | ||
|
||
RELEASE_NOTES=$(gh release view "$VERSION" --json body --jq .body) | ||
|
||
BREAKING_CHANGES_HEADER="Breaking Changes" | ||
RELEASE_NOTES_HEADER="Release Notes" | ||
|
||
commit_message_re="-\s(.*)\s(\(#[0-9]+\)\s@.*)" | ||
rls_header_re="^##.*(Features|$BREAKING_CHANGES_HEADER|Bug Fixes|Fixed Vulnerabilities)" | ||
|
||
extract_header() { | ||
local commit="$1" | ||
local header_name="$2" | ||
awk " | ||
/^\s?$/ {next} | ||
/## $header_name/ {rn=1} | ||
rn && !/^##/ {print}; | ||
/##/ && !/## $header_name/ {rn=0}" <<<"$commit" | ||
} | ||
|
||
indent() { | ||
while IFS= read -r line; do | ||
printf " %s\n" "${line%"${line##*[![:space:]]}"}" | ||
done <<<"$1" | ||
} | ||
|
||
new_notes="" | ||
rls_header="" | ||
while IFS= read -r line; do | ||
new_notes+="$line\n" | ||
if [[ $line == \##* ]]; then | ||
if ! [[ $line =~ $rls_header_re ]]; then | ||
rls_header="" | ||
continue | ||
fi | ||
rls_header="${BASH_REMATCH[1]}" | ||
fi | ||
if [[ $rls_header == "" ]]; then | ||
continue | ||
fi | ||
if [[ $line != -* ]]; then | ||
continue | ||
fi | ||
if ! [[ $line =~ $commit_message_re ]]; then | ||
continue | ||
fi | ||
commit_msg="${BASH_REMATCH[1]}" | ||
commit_body=$(git log --grep "$commit_msg" -n1 --pretty="%b") | ||
|
||
add_notes() { | ||
local notes="$1" | ||
if [[ $notes != "" ]]; then | ||
new_notes+=$(indent "> $notes") | ||
new_notes+="\n" | ||
fi | ||
} | ||
|
||
rn=$(extract_header "$commit_body" "$RELEASE_NOTES_HEADER") | ||
bc=$(extract_header "$commit_body" "$BREAKING_CHANGES_HEADER") | ||
|
||
case $rls_header in | ||
"$BREAKING_CHANGES_HEADER") add_notes "$bc" ;; | ||
*) add_notes "$rn" ;; | ||
esac | ||
|
||
done <<<"$RELEASE_NOTES" | ||
|
||
echo "Uploading release notes for $VERSION" | ||
# shellcheck disable=2059 | ||
printf "$new_notes" | gh release edit "$VERSION" --verify-tag -F - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
on: | ||
pull_request: | ||
types: [opened, reopened, edited] | ||
merge_group: | ||
name: pr-title | ||
jobs: | ||
pr-title-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Slashgear/[email protected] | ||
with: | ||
regexp: "(feat|fix|sec|infra|test|chore|doc): .{5,}" | ||
helpMessage: "Example: 'feat: new pr title check BE-143' <- prefix, colon, space, PR title of at least 5 chars (with ticket number strongly suggested, but not mandatory)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# pull_request event is required only for autolabeler | ||
# 'edited' event is required to account for initial invalid PR names | ||
pull_request: | ||
types: [opened, reopened, synchronize, edited] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_LABELER_TOKEN }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
# Drafts your next Release notes as Pull Requests are merged into "main" | ||
- id: drafter | ||
uses: release-drafter/release-drafter@v5 | ||
- name: Add release notes to the draft | ||
if: github.event_name == 'push' | ||
run: .github/scripts/release-notes.sh ${{ steps.drafter.outputs.tag_name }} |