From 4e7c463d0333cd499acfc5724e86432a320db03c Mon Sep 17 00:00:00 2001 From: swayne275 Date: Wed, 2 Mar 2022 08:54:02 -0700 Subject: [PATCH] fix ent changelog check (#14312) * fix ent changelog check * update for consistency but verify * undo test * add logging --- .github/workflows/changelog-checker.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog-checker.yml b/.github/workflows/changelog-checker.yml index 44378dc117..a30b5e3817 100644 --- a/.github/workflows/changelog-checker.yml +++ b/.github/workflows/changelog-checker.yml @@ -25,11 +25,18 @@ jobs: - name: Check for changelog entry in diff run: | # check if there is a diff in the changelog directory - changelog_files=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/${{ github.event.pull_request.base.ref }}")" -- changelog/${{ github.event.pull_request.number }}.txt) + if [ ${{ github.event.repository.name }} == "vault-enterprise" ]; then + expected_changelog_file=changelog/_${{ github.event.pull_request.number }}.txt + else + expected_changelog_file=changelog/${{ github.event.pull_request.number }}.txt + fi + + echo "looking for changelog file ${expected_changelog_file}" + changelog_files=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/${{ github.event.pull_request.base.ref }}")" -- ${expected_changelog_file}) # If we do not find a file matching the PR # in changelog/, we fail the check if [ -z "$changelog_files" ]; then - echo "Did not find a changelog entry named ${{ github.event.pull_request.number }}.txt" + echo "Did not find a changelog entry named ${expected_changelog_file}" echo "If your changelog file is correct, skip this check with the 'pr/no-changelog' label" echo "Reference - https://github.com/hashicorp/vault/pull/10363 and https://github.com/hashicorp/vault/pull/11894" exit 1