Skip to content

Commit

Permalink
fix: trailing spaces cause conditionals to evaluate incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdguy committed Nov 20, 2023
1 parent b3b858d commit 558d1ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/version-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ jobs:
if [ -f NEWS.md ]
then {
git config --global --add safe.directory $(pwd)
DESC_VERSION=$(R --slave -e 'cat(paste(desc::desc_get_version()))' | tr -d '\n')
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md | tr -d '\n')
DESC_VERSION=$(R --slave -e 'cat(paste(desc::desc_get_version()))' | tr -d '\n' | xargs)
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md | tr -d '\n' | xargs)
FIRST_NEWS_LINE=$(head -1 NEWS.md)
if [ "${{ inputs.vbump-after-release }}" == "true" ]; then
# Add a new section with the released version that will be vbumped below.
Expand All @@ -87,7 +87,7 @@ jobs:
fi
# Replace only the first occurence of $NEWS_VERSION,
# but only if it's not already set to (development version)
if [ "${NEWS_VERSION}" != "(development version)" ]
if [ $NEWS_VERSION != "(development version)" ]
then {
sed -i "0,/$NEWS_VERSION/s/$NEWS_VERSION/$DESC_VERSION/" NEWS.md
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:

- name: NEWS.md and DESCRIPTION Version check 🏁
run: |
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION | tr -d '\n')
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md | tr -d '\n')
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION | tr -d '\n' | xargs)
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md | tr -d '\n' | xargs)
DESC_DEV_VERSION=$(echo $DESC_VERSION | awk -F '.' '{print $NF}')
echo "NEWS.md version: $NEWS_VERSION"
echo "DESCRIPTION version: $DESC_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# r.pkg.template 0.1.0.9130
# r.pkg.template 0.1.0.9131

### New features

Expand Down

0 comments on commit 558d1ed

Please sign in to comment.