Skip to content

Commit 8eed26e

Browse files
committed
Adding release notes action
1 parent a81ee10 commit 8eed26e

File tree

4 files changed

+58
-15
lines changed

4 files changed

+58
-15
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Setup Ubuntu Runner Host'
2+
inputs:
3+
python-version:
4+
description: 'Python version to use'
5+
required: true
6+
default: '3.13'
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Check out repository code
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: '0'
14+
- name: setup python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: ${{inputs.python-version}}
18+
cache: 'pip' # caching pip dependencies
19+
- name: Install dependencies
20+
shell: bash
21+
run: |
22+
sudo apt-get install libldap2-dev libsasl2-dev # Required for python-ldap
23+
pip install --upgrade pip
24+
pip install -r requirements.txt
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Preview Release Notes
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release-*
7+
pull_request:
8+
branches:
9+
- master
10+
- release-*
11+
12+
jobs:
13+
preview_release_notes:
14+
name: Preview Release Notes
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Setup host
18+
uses: ./.github/actions/setup-ubuntu-host
19+
with:
20+
python-version: '${{ vars.PYTHON_VERSION }}'
21+
- name: Generate Release Notes
22+
id: generate_release_notes
23+
run: python -m scripts.release.release_notes -s $INITIAL_COMMIT_SHA -v $INITIAL_VERSION -o release_notes_tmp.md
24+
env:
25+
INITIAL_COMMIT_SHA: ${{ vars.RELEASE_INITIAL_COMMIT_SHA }}
26+
INITIAL_VERSION: ${{ vars.RELEASE_INITIAL_VERSION }}
27+
- name: Summarize results
28+
run: echo $(cat release_notes_tmp.md) >> $GITHUB_STEP_SUMMARY

.github/workflows/require_changelog.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,15 @@ on:
1111

1212
jobs:
1313
validate-changelog:
14+
name: Check for valid changelog entry in Pull Request
1415
runs-on: ubuntu-latest
1516
steps:
16-
- name: Check out repository code
17-
uses: actions/checkout@v4
17+
- name: Setup host
18+
uses: ./.github/actions/setup-ubuntu-host
1819
with:
19-
fetch-depth: '0'
20-
- name: setup python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: 3.13 # Make this env var
24-
cache: 'pip' # caching pip dependencies
25-
- name: Install dependencies
26-
run: |
27-
sudo apt-get install libldap2-dev libsasl2-dev # Required for python-ldap
28-
pip install --upgrade pip
29-
pip install -r requirements.txt
20+
python-version: '${{ vars.PYTHON_VERSION }}'
3021
- name: Check if changelog entry file was added in this PR
31-
run: python -m scripts.release.check_changelog --base-sha "$BASE_SHA" --fail-on-no-changes $FAIL_ON_NO_CHANGES
22+
run: python -m scripts.release.check_changelog -b $BASE_SHA -f $FAIL_ON_NO_CHANGES >> $GITHUB_STEP_SUMMARY
3223
env:
3324
BASE_SHA: ${{ github.event.pull_request.base.sha }}
3425
FAIL_ON_NO_CHANGES: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }}

scripts/release/check_changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def str2bool(v):
4141
help=f"Path to the changelog directory relative to the repository root. Default is '{DEFAULT_CHANGELOG_PATH}'",
4242
)
4343
parser.add_argument(
44-
"-t",
44+
"-b",
4545
"--base-sha",
4646
metavar="",
4747
action="store",

0 commit comments

Comments
 (0)