-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Check news | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
python-version: '3.10' | ||
dependabot_user: "dependabot[bot]" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Check that a news file has been added to this branch when a PR is created | ||
assert-news: | ||
name: Assert news files | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
# Checkout with full history for to allow compare with base branch | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Towncrier is written in Python | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.python-version }} | ||
|
||
- name: Check for dependabot user | ||
if: github.event.pull_request.user.login == env.dependabot_user | ||
run: | | ||
echo "::warning:: Skipping news file check as this is a dependency update and not included in the release notes." | ||
- name: Install CI tools | ||
if: github.event.pull_request.user.login != env.dependabot_user | ||
run: pip install towncrier | ||
|
||
# Fetch the base branch for the pull request so that towncrier can compare the current branch with the base branch. | ||
- name: Check for news fragments | ||
if: github.event.pull_request.user.login != env.dependabot_user | ||
run: | | ||
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH} | ||
python -m towncrier.check --compare-with origin/${BASE_BRANCH} | ||
env: | ||
BASE_BRANCH: ${{ github.base_ref }} | ||
|
||
- name: Report failure if needed | ||
if: ${{ failure() }} | ||
run: | | ||
echo "::error:: A news fragment explaining the change must be present in a pull request." |
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 |
---|---|---|
|
@@ -52,8 +52,8 @@ jobs: | |
- name: Commit changes | ||
uses: EndBug/[email protected] | ||
with: | ||
author_name: monty-bot | ||
author_email: monty-bot@arm.com | ||
author_name: otg-platform[bot] | ||
author_email: 140601826+otg-platform[bot]@users.noreply.github.com | ||
message: "Release v${{ env.SEMVER_VERSION }} [skip ci]" | ||
add: "changes" | ||
tag: "v${{ env.SEMVER_VERSION }} -m 'Release v${{ env.SEMVER_VERSION }}'" | ||
|
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 @@ | ||
Add release workflow |