Skip to content

Commit b7422ba

Browse files
committed
ci: add check to ensure composer-bin is not accidentally committed
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent 9e0e537 commit b7422ba

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/autocheckers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- 'composer.json'
3737
- 'composer.lock'
3838
- '**.php'
39+
- build/autoloaderchecker.sh
3940
4041
autoloader:
4142
runs-on: ubuntu-latest

build/autoloaderchecker.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ echo
3434
echo "Regenerating main autoloader"
3535
$COMPOSER_COMMAND dump-autoload -d $REPODIR
3636

37+
FOUND_COMPOSER_BIN=$(grep --recursive --fixed-strings 'Bamarni\\Composer\\Bin' $REPODIR/lib/composer/composer/)
38+
if [ -n "$FOUND_COMPOSER_BIN" ]; then
39+
echo "The main autoloader contains the composer bin plugin"
40+
echo "Run composer again with --no-dev and commit the result"
41+
exit 1
42+
fi
43+
3744
for app in ${REPODIR}/apps/*; do
3845
if git check-ignore ${app} -q ; then
3946
echo

0 commit comments

Comments
 (0)