-
-
Save alle/c3646161b4507f820d5e5f346679a298 to your computer and use it in GitHub Desktop.
How to check in CI if any Composer dependency can be upgraded, using a committed file as a way to ignore upgrades blocked by external factors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for package in `composer outdated | awk '{ print $1":"$4 }'`; | |
do | |
echo "New version: $package" > outdated-status.txt | |
composer why-not $package > outdated-status.txt | |
echo "----------" > outdated-status.txt | |
done | |
if [ -z $(git status --porcelain) ]; | |
then | |
echo "Nothing changed" | |
exit 0; | |
else | |
echo "SOMETHING CHANGED, PLEASE UPDATE DEPS!" | |
git diff | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment