Skip to content

Releases: captainhookphp/captainhook

5.22.0

06 Mar 11:05
5.22.0
9185d04
Compare
Choose a tag to compare

Changes

  • Convert hook stdIn to cmd option
  • Add confirmation action
  • Hook script compatibility check
  • BlockFixupCommits action got some verbose output

⚠️ Attention ⚠️

This version contains a bigger change that requires to update the generated hook scripts.
This is necessary because the decision was made to convert the original hook stdIn to a cmd option --input to allow prompting the user for input for all hooks as long as a tty is available.

A new Action was added to ask users if they want to continue with the current git operation. The action uses event handler to make sure that users are only bothered to input something if the hook succeeds. Both options are optional and can be skipped.

            {
                "action": "\\CaptainHook\\App\\Hook\\UserInput\\AskConfirmation",
                "options": {
                    "message": "Do you really want it? [yes|no]",
                    "default": true
                },
                "config": {
                    "label": "User confirmation!"
                }
            }

Short note: This action does not work in GUI tools like Sourcetree, or PHPStorm because they fail to forward the tty properly.

User input should be possible for all hooks now as long as you use run-mode shell (default) or docker. In run-mode php user input does not work for pre-push and post-rewrite because data can not be read from stdIn and tty at the same time and both hooks require stdIn data to work properly.

5.21.2

23 Jan 13:11
5.21.2
f0911f6
Compare
Choose a tag to compare

Changes

  • Fix double '..' revision range for {$BRANCH_FILES} placeholder

5.21.1

23 Jan 12:35
5.21.1
b50216b
Compare
Choose a tag to compare

Changes

  • Allow skipping options for Branch\Files Condition

5.21.0

23 Jan 11:05
5.21.0
5d1926b
Compare
Choose a tag to compare

Changes

  • Revert reflog fallback for {$CHANGED_FILES} introduced in 5.20.0
  • Add new Branch\Files condition
  • Add new {$BRANCH_FILES} placeholder

5.20.2

22 Jan 15:39
5.20.2
e485ec7
Compare
Choose a tag to compare

Changes

  • Add conditions to check current branch by regex inspired by @Eydamos ;)
  • Add On and NotOn branch conditions

The Condition\OnBranch condition is now deprecated and should be replaced with Condition\Branch\On.
Full list of Conditions can be found here

5.20.1

22 Jan 12:13
5.20.1
be5608c
Compare
Choose a tag to compare

Changes

  • Add IntegrateBeforePush action
  • Add proper filter settings to not list deleted files
  • Properly check the detected ranges
  • Split debug action into Success and Failure

5.20.0

19 Jan 19:50
5.20.0
cebfe57
Compare
Choose a tag to compare

Changes

  • Refactor and optimize changeset discovery huge thanks to @Eydamos
  • Output executed cli command anyway in verbose mode
  • Fix branch extraction
  • Catch condition exceptions

🐛 Bugfixes

#233 #234

5.19.2

18 Dec 14:07
5.19.2
604bfc5
Compare
Choose a tag to compare

Changes

5.19.1

15 Dec 09:22
5.19.1
93ef43a
Compare
Choose a tag to compare

Changes

This release focuses on cleaning up the installation and plugin confusion.
From this point forward the captainhook/composer-plugin is deprecated and "replaced" by captainhook/hook-installer.

The decision was made because the composer-plugin package was doing too much. And by requiring captainhook directly it did not give you the opportunity to choose the CaptainHook installation method yourself.

The new hook-installer package is only focusing on the functionality of activating the hooks for all your team members.
Especially because of an issue @Eydamos pointed out. The Composer "script" solution has some serious drawbacks when installing dependencies with --no-dev. You can follow the discussion over here.

From now on, to automate the hook activation, you should combine your preferred way of installing the Cap'n with requiring the hook-installer package.

Examples

Installing the Cap'n as PHAR via Composer

{
  "require-dev": {
    "captainhook/captainhook-phar": "^5.19",
    "captainhook/hook-installer": "^1.0"
  }  
}

Installing the Captain's source code and its dependencies with composer.

{
  "require-dev": {
    "captainhook/captainhook": "^5.19",
    "captainhook/hook-installer": "^1.0"
  }  
}

Installing the Cap'n via PHIVE and the hook-installer via composer.

{
  "require-dev": {
    "captainhook/hook-installer": "^1.0"
  },
  "extra": {
    "captainhook": {
      "exec": "tools/captainhook.phar"
    }
  }
}

5.19.0

01 Dec 14:36
5.19.0
6109b0f
Compare
Choose a tag to compare

Changes

  • Increased PHP requirement to >= 8.0
  • Overhauled the complete action output handling
  • Add BlockSecrets action
  • Improve export ignore
  • Move some HookRunner logic to Config
  • Remove php 7.4 build
  • Remove unused import
  • Cleanup hook argument handling

Issues Fixed

#28, #230