Skip to content

Instantly share code, notes, and snippets.

@alle
Forked from Jean85/composer-outdated.sh
Created February 22, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alle/c3646161b4507f820d5e5f346679a298 to your computer and use it in GitHub Desktop.
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.
#!/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