Skip to content

Commit

Permalink
Merge pull request #78 from linkorb/remve-git-pre-push-hook-8978
Browse files Browse the repository at this point in the history
fix: disable composer-unused git push check #8978
  • Loading branch information
mhitza authored Oct 7, 2024
2 parents e6f224b + 4b3054d commit 16abcc5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
14 changes: 10 additions & 4 deletions tasks/php-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
path: "{{ repo_path + '/.github/' }}"
register: directory_exists

- name: Generate composer-unused.php file
ansible.builtin.template:
src: "{{ './templates/php-qa/composer-unused.php.j2' }}"
dest: "{{ repo_path + '/composer-unused.php' }}"
- name: Ensure composer-unused.php is absent
ansible.builtin.file:
path: "{{ repo_path + '/composer-unused.php' }}"
state: absent

# XXX: composer-unused as part of Card (epic) 8980
#- name: Generate composer-unused.php file
# ansible.builtin.template:
# src: "{{ './templates/php-qa/composer-unused.php.j2' }}"
# dest: "{{ repo_path + '/composer-unused.php' }}"

- name: Generate .php-cs-fixer.dist.php file
ansible.builtin.template:
Expand Down
2 changes: 0 additions & 2 deletions templates/.devcontainer/postCreate.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED || true
git config commit.template .devcontainer/git/linkorb_commit.template

{% if repo.type in ['application', 'library', 'symfony-bundle'] or repo.type.startswith('php-') %}
cp .devcontainer/git/hooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push

{% if repo.devcontainer.private_packagist %}
composer config --global --auth http-basic.repo.packagist.com "$GITHUB_USER" "$PACKAGIST_TOKEN"
Expand Down
7 changes: 7 additions & 0 deletions templates/.devcontainer/postStart.sh.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env bash
# {{ repo_managed }}

# pre-push composer-unused hook disabled. See Card #8980
if [ -f .git/hooks/pre-push ]; then
diff .devcontainer/git/hooks/pre-push .git/hooks/pre-push
if [ $? -eq 0 ]; then
rm .git/hooks/pre-push
fi
fi
{{ repo.devcontainer.postStartCommand|default('') }}

0 comments on commit 16abcc5

Please sign in to comment.