diff --git a/.github/workflows/filterDuplicates.js b/.github/workflows/filterDuplicates.js index af8539c5849..2bb9d440cb5 100644 --- a/.github/workflows/filterDuplicates.js +++ b/.github/workflows/filterDuplicates.js @@ -111,9 +111,6 @@ async function run() { console.log('%s duplicates found', filteredDuplicates.length) if (filteredDuplicates.length > 0) { console.log(formatDuplicates(filteredDuplicates, commitHash, repoName)) - console.log( - '* Hint: if these duplicates appear unrelated to the changes, rebase onto the latest target branch.' - ) process.exit(1) } } diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e8c301c18be..5785d1b14a6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -84,6 +84,17 @@ jobs: git remote add forkUpstream https://github.com/$REPO_NAME # URL of the fork git fetch forkUpstream # Fetch fork + - name: Merge in target branch to avoid false negatives. + env: + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + # Note: "git merge" should always succeed here, because GHA won't + # start the job if there are merge conflicts. https://github.com/orgs/community/discussions/11265 + # Also, because `git merge` makes a commit, we need to establish an identity to avoid 'Committer identity unknown' error + run: | + git config --global user.name "aws-toolkit-automation" + git config --global user.email "<>" + git merge origin/$TARGET_BRANCH + - name: Compute git diff env: CURRENT_BRANCH: ${{ github.head_ref }}