Skip to content

Commit

Permalink
ci: Refactor changelog workflow to use reusable workflow (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjjaramillo authored Oct 2, 2023
1 parent 4fb99de commit 414bd15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,8 @@ name: changelog

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

jobs:
changelog-entry:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog')}}

steps:
- uses: actions/checkout@v4
- name: Check for CHANGELOG file changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep --ignore-case CHANGELOG) ]]
then
echo "The CHANGELOG file was modified. Looks good!"
else
echo "The CHANGELOG file was not modified."
echo "Please add a CHANGELOG entry to the appropriate header under \"Unreleased\", or add the \"Skip Changelog\" label if not required."
false
fi
lint-changelog:
runs-on: ubuntu-latest
needs: changelog-entry
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check if CHANGELOG is valid
uses: newrelic/release-toolkit/validate-markdown@v1
check-changelog:
uses: newrelic/k8s-metadata-injection/.github/workflows/changelog-reusable.yml@main
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### bugfix
- Fix bug reported in [NR-153839](https://issues.newrelic.com/browse/NR-153839) by @juanjjaramillo in [#319](https://github.com/newrelic/newrelic-infra-operator/pull/319)
### enhancement
- Update k8s versions in CI by @xqi-nr in https://github.com/newrelic/newrelic-infra-operator/pull/323
- Update k8s versions in CI by @xqi-nr in [#323](https://github.com/newrelic/newrelic-infra-operator/pull/323)
- Refactor `changelog` workflow to use reusable workflow by @juanjjaramillo in [#339](https://github.com/newrelic/newrelic-infra-operator/pull/339)

## [0.10.2]

Expand Down

0 comments on commit 414bd15

Please sign in to comment.