Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#291: Project improvements after 0.3.0 release #300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
persist-credentials: false
- uses: coursier/cache-action@v5

- name: Setup Scala
Expand Down Expand Up @@ -64,7 +65,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
persist-credentials: false
- uses: coursier/cache-action@v5

- name: Setup Scala
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/check_pr_release_notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#
# Copyright 2021 ABSA Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Check PR Release Notes in Description

on:
pull_request:
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
branches: [ master ]

env:
SKIP_LABEL: 'no RN'
RLS_NOTES_TAG_REGEX: 'Release Notes:'

jobs:
check-pr-release-notes:
runs-on: ubuntu-latest

steps:
- name: Get Pull Request Info
id: pr_info
uses: actions/github-script@v7
with:
script: |
const pr_number = context.payload.pull_request.number;
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr_number
});
const labels = pr.data.labels ? pr.data.labels.map(label => label.name) : [];

if (labels.includes("${{ env.SKIP_LABEL }}")) {
console.log("Skipping release notes check because '${{ env.SKIP_LABEL }}' label is present.");
core.setOutput("skip_check", 'true');
core.setOutput("pr_body", "");
return;
}

const pr_body = pr.data.body;
if (!pr_body) {
core.setFailed("Pull request description is empty.");
core.setOutput("pr_body", "");
core.setOutput("skip_check", 'false');
return;
}
core.setOutput("pr_body", pr_body);
core.setOutput("skip_check", 'false');
return;

- name: Skip check if SKIP_LABEL is present
if: steps.pr_info.outputs.skip_check == 'true'
run: echo "Skipping release notes validation."

- name: Check for 'Release Notes:' and bullet list
if: steps.pr_info.outputs.skip_check == 'false'
run: |
# Extract the body from the previous step
PR_BODY=$(cat <<-'EOF'
${{ steps.pr_info.outputs.pr_body }}
EOF
)

# Check if "Release Notes:" exists
if ! echo "$PR_BODY" | grep -q '${{ env.RLS_NOTES_TAG_REGEX }}'; then
echo "Error: release notes tag not found in pull request description. Has to adhere to format '${{ env.RLS_NOTES_TAG_REGEX }}'."
exit 1
fi

# Extract text after "Release Notes:" line
TEXT_BELOW_RELEASE_NOTES_TAG=$(echo "$PR_BODY" | sed -n '/${{ env.RLS_NOTES_TAG_REGEX }}/,$p' | tail -n +2)

# Check if there's a bullet list (lines starting with '-', '+' or '*')
if ! echo "$TEXT_BELOW_RELEASE_NOTES_TAG" | grep -qE '^\s*[-+*]\s+.+$'; then
echo "Error: No bullet list found under release notes tag."
exit 1
fi
3 changes: 2 additions & 1 deletion .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/jacoco_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
Expand Down
94 changes: 0 additions & 94 deletions .github/workflows/pr_release_note_comment_check.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
# the following step is disabled because it doesn't order the version tags correctly
# - name: Validate format of received tag
Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
ref: refs/tags/${{ github.event.inputs.tagName }}

Expand All @@ -119,10 +121,17 @@ jobs:
with:
tag-name: ${{ github.event.inputs.tagName }}
chapters: '[
{"title": "No entry 🚫", "label": "duplicate"},
{"title": "No entry 🚫", "label": "invalid"},
{"title": "No entry 🚫", "label": "wontfix"},
{"title": "No entry 🚫", "label": "no RN"},
{"title": "Breaking Changes 💥", "label": "breaking-change"},
{"title": "New Features 🎉", "label": "enhancement"},
{"title": "New Features 🎉", "label": "feature"},
{"title": "Bugfixes 🛠", "label": "bug"}
{"title": "Bugfixes 🛠", "label": "bug"},
{"title": "Infrastructure ⚙️", "label": "infrastructure"},
{"title": "Silent-live 🤫", "label": "silent-live"},
{"title": "Documentation 📜", "label": "documentation"}
]'
duplicity-scope: 'service'
duplicity-icon: '🔁'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: coursier/cache-action@v5

Expand All @@ -51,6 +52,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: coursier/cache-action@v5

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_filenames_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Filename Inspector
id: scan-test-files
Expand Down
Loading
Loading