Skip to content

Commit f776625

Browse files
authored
Merge pull request #5335 from IntersectMBO/nm/changelog-linting-exit-status
Improve error checking in CI changelog linting
2 parents a48864f + 631f3ed commit f776625

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.github/workflows/haskell.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -655,16 +655,16 @@ jobs:
655655
- name: Install changelog linter
656656
run: |
657657
REPO=cardano-ledger-release-tool
658-
RELEASE=cardano-ledger-release-tool-0.1.0.0
659-
curl -sSfL "https://github.com/input-output-hk/$REPO/releases/download/$RELEASE/$REPO-Linux-x86_64.zip" -o $REPO.zip
658+
RELEASE=0.1.1.0 # Should match nix/pkgs/cardano-ledger-release-tool.nix
659+
curl -sSfL "https://github.com/input-output-hk/$REPO/releases/download/$RELEASE/$REPO-Linux-x86_64-$RELEASE.tgz" -o $REPO.tgz
660660
BINDIR=$HOME/.local/bin
661661
mkdir -p "$BINDIR"
662-
unzip -qo $REPO.zip -d "$BINDIR"
663-
rm $REPO.zip
662+
tar -xvf $REPO.tgz --strip-components=1 -C "$BINDIR"
663+
rm $REPO.tgz
664664
echo "$BINDIR" >> ${GITHUB_PATH-/dev/null}
665665
666666
- name: Run linter
667-
run: scripts/format-changelogs.sh || git diff --exit-code
667+
run: scripts/format-changelogs.sh || (git diff; false)
668668

669669
- name: Check if changelogs need a bump
670670
run: scripts/bump-changelogs.sh || (git diff; false)

nix/pkgs/cardano-ledger-release-tool.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ let
33
type = "github";
44
owner = "input-output-hk";
55
repo = "cardano-ledger-release-tool";
6-
rev = "f52262644af02e6eae54cf5d6021ecebf7f5c1d1";
6+
rev = "98b7da19a6e385c62292125a5cede79f444dd9b9"; # git rev-parse 0.1.1.0
77
in
88
(builtins.getFlake "${type}:${owner}/${repo}/${rev}").packages.${system}.default

scripts/format-changelogs.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ then
99
mapfile -t FILES < <(git ls-files '*CHANGELOG.md')
1010
fi
1111

12-
cardano-ledger-release-tool changelogs -i "${FILES[@]}"
12+
clrt changelogs -i "${FILES[@]}"
1313

14-
git diff -s --exit-code "${FILES[@]}"
14+
if ! git diff -s --exit-code "${FILES[@]}"
15+
then
16+
if [ -t 2 ]
17+
then
18+
# shellcheck disable=SC2016
19+
echo 'Some changelogs were modified - use `git diff` to see the changes' >&2
20+
fi
21+
false
22+
fi

0 commit comments

Comments
 (0)