From 414bd1592957111d48a04c3d0489259cfc4a881e Mon Sep 17 00:00:00 2001 From: Juan Jose Jaramillo Date: Mon, 2 Oct 2023 15:55:57 -0700 Subject: [PATCH] ci: Refactor `changelog` workflow to use reusable workflow (#339) --- .github/workflows/changelog.yml | 31 +++---------------------------- CHANGELOG.md | 3 ++- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 812edb46..5a2b773c 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index e00e8368..1d00fc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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]