Skip to content

Commit

Permalink
Add git diff to Podfile.lock diverged annotation (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio authored May 25, 2023
1 parent 6ce9ffd commit 7e40e7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ _None._
### Bug Fixes
- Fix the `annotate_test_failures` to include test cases with error nodes in the failures list. [#58]
_None._
### Internal Changes
Expand All @@ -38,11 +38,11 @@ _None._

### New Features

_None._
- When `install_cocoapods` fails because `Podfile.lock` changed in CI, it now prints a diff of the changes [#59]

### Bug Fixes

_None._
- Fix the `annotate_test_failures` to include test cases with error nodes in the failures list. [#58]

### Internal Changes

Expand Down
14 changes: 13 additions & 1 deletion bin/install_cocoapods
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,20 @@ else
fi

function lockfile_error () {
message="\`Podfile.lock\` was changed by \`bundle exec pod install\`. Please run \`bundle exec pod install\` locally with a clean cache and commit the result."
message=$(cat <<EOF
\`Podfile.lock\` was changed by \`bundle exec pod install\`. Please run \`bundle exec pod install\` locally with a clean cache and commit the result.
<details><summary>See diff</summary>
\`\`\`
$(git diff -- Podfile.lock)
\`\`\`
</details>
EOF
)

echo "$message"

buildkite-agent annotate "$message" --style 'error' --context 'ctx-error'
}
trap lockfile_error ERR
Expand Down

0 comments on commit 7e40e7a

Please sign in to comment.