Skip to content

Commit

Permalink
Update analysis.yml
Browse files Browse the repository at this point in the history
Fix indenting
  • Loading branch information
BlinkDynamo authored Jun 11, 2024
1 parent a1f5f8a commit eb3fab1
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,36 +103,36 @@ jobs:
- name: Release Version and Date Analysis
run: |
# search for release and date line from CITATION.cff with format:
# 'version: X.X.X' and 'date-released: XXXX-XX-XX' then extract to variables

# find the line with each, then extract the value wanted (version number or date) as well as line number
version_citation_info=$(grep -n -E -m1 '^version: [0-9]+\.[0-9]+\.[0-9]+' "../../CITATION.cff")
version_citation_line=$(echo "$version_citation_info" | cut -d: -f1)
version_citation=$(echo "$version_citation_info" | awk '{print $2}')

date_citation_info=$(grep -n -E -m1 'date-released: [0-9]{4}-[0-9]{2}-[0-9]{2}' "../../CITATION.cff")
date_citation_line=$(echo "$date_citation_info" | cut -d: -f1)
date_citation=$(echo "$date_citation_info" | awk '{print $2}')

# search for version and date line from ChangeLog.md with format:
# '## [X.X.X] - [XX-XX-XXXX]'

# find most recent line with version and date of release in ChangeLog.md
vd_changelog_info=$(grep -n -E -m1 '## \[[0-9]+\.[0-9]+\.[0-9]+\] - [0-9]{4}-[0-9]{2}-[0-9]{2}' "../../ChangeLog.md")
vd_changelog_line=$(echo "$vd_changelog_info" | cut -d: -f1)

# extract version, date and line number (since it's always on one line) to variables
version_changelog=$(echo "$vd_changelog_info" | awk -F'[][]' '{print $2}')
date_changelog=$(echo "$vd_changelog_info" | awk -F' - ' '{print $2}')


# compare version numbers and dates between files, listing discrepancies where found
if [[ "$version_changelog" != "$version_citation" ]]; then
echo "Release version numbers do not match: $version_changelog (ChangeLog.md on line $vd_changelog_line) vs $version_citation (CITATION.cff on line $version_citation_line)"
exit 1
fi

if [[ "$date_changelog" != "$date_citation" ]]; then
echo "Release dates do not match: $date_changelog (ChangeLog.md on line $vd_changelog_line) vs $date_citation (CITATION.cff on line $date_citation_line)"
exit 1
fi
# 'version: X.X.X' and 'date-released: XXXX-XX-XX' then extract to variables
# find the line with each, then extract the value wanted (version number or date) as well as line number
version_citation_info=$(grep -n -E -m1 '^version: [0-9]+\.[0-9]+\.[0-9]+' "../../CITATION.cff")
version_citation_line=$(echo "$version_citation_info" | cut -d: -f1)
version_citation=$(echo "$version_citation_info" | awk '{print $2}')
date_citation_info=$(grep -n -E -m1 'date-released: [0-9]{4}-[0-9]{2}-[0-9]{2}' "../../CITATION.cff")
date_citation_line=$(echo "$date_citation_info" | cut -d: -f1)
date_citation=$(echo "$date_citation_info" | awk '{print $2}')
# search for version and date line from ChangeLog.md with format:
# '## [X.X.X] - [XX-XX-XXXX]'
# find most recent line with version and date of release in ChangeLog.md
vd_changelog_info=$(grep -n -E -m1 '## \[[0-9]+\.[0-9]+\.[0-9]+\] - [0-9]{4}-[0-9]{2}-[0-9]{2}' "../../ChangeLog.md")
vd_changelog_line=$(echo "$vd_changelog_info" | cut -d: -f1)
# extract version, date and line number (since it's always on one line) to variables
version_changelog=$(echo "$vd_changelog_info" | awk -F'[][]' '{print $2}')
date_changelog=$(echo "$vd_changelog_info" | awk -F' - ' '{print $2}')
# compare version numbers and dates between files, listing discrepancies where found
if [[ "$version_changelog" != "$version_citation" ]]; then
echo "Release version numbers do not match: $version_changelog (ChangeLog.md on line $vd_changelog_line) vs $version_citation (CITATION.cff on line $version_citation_line)"
exit 1
fi
if [[ "$date_changelog" != "$date_citation" ]]; then
echo "Release dates do not match: $date_changelog (ChangeLog.md on line $vd_changelog_line) vs $date_citation (CITATION.cff on line $date_citation_line)"
exit 1
fi

0 comments on commit eb3fab1

Please sign in to comment.