Skip to content

Commit

Permalink
Merge pull request #3073 from galaxyproject/fix-matrix
Browse files Browse the repository at this point in the history
Fix matrix bot try 2 and ignore whitespace in change detection
  • Loading branch information
shiltemann authored Nov 24, 2021
2 parents 158a71d + 1885298 commit 777296b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,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 }}
8 changes: 4 additions & 4 deletions bin/news.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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")}"
Expand Down

0 comments on commit 777296b

Please sign in to comment.