From 188529856f0625da47eeb186d1570c462805f6ac Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 24 Nov 2021 13:51:13 +0100 Subject: [PATCH] ignore whitespace in change detection --- .github/workflows/matrix.yml | 2 +- bin/news.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index cc5531dbc21b7b..ca64a35453331c 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -28,4 +28,4 @@ jobs: commit=$(git log --since "24 hours ago" --format=%H | tail -n 1) bundle exec ruby bin/news.rb -p "${commit}~1" --matrix-post env: - MATRIX_ACCESS_TOKEN: ${{ github.matrix_access_token }} + MATRIX_ACCESS_TOKEN: ${{ secrets.matrix_access_token }} diff --git a/bin/news.rb b/bin/news.rb index 60448c91818615..bba0bb2984bc12 100644 --- a/bin/news.rb +++ b/bin/news.rb @@ -18,8 +18,8 @@ exit 1 end -addedfiles =`git diff --cached --name-only --diff-filter=A #{options[:previousCommit]}`.split("\n") -modifiedfiles =`git diff --cached --name-only --diff-filter=M #{options[:previousCommit]}`.split("\n") +addedfiles =`git diff --cached --name-only --ignore-all-space --diff-filter=A #{options[:previousCommit]}`.split("\n") +modifiedfiles =`git diff --cached --name-only --ignore-all-space --diff-filter=M #{options[:previousCommit]}`.split("\n") NOW = Time.now CONTRIBUTORS = YAML.load_file('CONTRIBUTORS.yaml') @@ -58,8 +58,8 @@ def printableMaterial(path) #'slides': modifiedfiles.select{|x| filterSlides(x)}, #'tutorials': modifiedfiles.select{|x| filterTutorials(x)}, #}, - 'contributors': `git diff --unified #{options[:previousCommit]} CONTRIBUTORS.yaml` - .split("\n").select{|line| line =~ /^+[^ ]+:\s*$/}.map{|x| x.strip()[1..-2]} + 'contributors': `git diff --unified --ignore-all-space #{options[:previousCommit]} CONTRIBUTORS.yaml` + .split("\n").select{|line| line =~ /^\+[^ ]+:\s*$/}.map{|x| x.strip()[1..-2]} } output = "# GTN News for #{NOW.strftime("%b %d")}"