diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-12-06 17:38:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-06 17:38:24 +0100 |
commit | 73ddb6daf98d7adee2dd0dc033723383e38b0ebe (patch) | |
tree | 9805e317fc84adb047619a9fbd5bb4b8c42fb1c0 | |
parent | 9628348a6a547db17f3867f48ae43ff71bbf6324 (diff) | |
download | rneovim-73ddb6daf98d7adee2dd0dc033723383e38b0ebe.tar.gz rneovim-73ddb6daf98d7adee2dd0dc033723383e38b0ebe.tar.bz2 rneovim-73ddb6daf98d7adee2dd0dc033723383e38b0ebe.zip |
ci(news): fetch full history (#21312)
We seem to need the parent commit of the earliest PR commit in order to
perform common git functionality to check which files were changed.
-rw-r--r-- | .github/workflows/news.yml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/.github/workflows/news.yml b/.github/workflows/news.yml index c838c150fe..8524641b11 100644 --- a/.github/workflows/news.yml +++ b/.github/workflows/news.yml @@ -9,16 +9,15 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ github.event.pull_request.commits }} + fetch-depth: 0 - name: news.txt needs to be updated run: | - for commit in $(git rev-list HEAD); do + for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do message=$(git log -n1 --pretty=format:%s $commit) type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then - git diff HEAD~$((${{ github.event.pull_request.commits }}-1)) --name-only | grep runtime/doc/news.txt || + ! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt || { echo " Pull request includes a new feature or a breaking change, but |