Issue
When executing a task triggering an Acquia Cloud Hook, you might face situations where the task fails because of a permission denied to execute
error for the hook file, as the following one
/var/www/html/[site].[env]/hooks/[env]/post-code-deploy/hookfile.sh: Permission denied
Resolution
As explained in the documentation Cloud API Hooks, Hook scripts must have the Unix "executable" bit in order to run
Once the permissions have been changed in your local repository you'll need to add, commit, and push them to Acquia Cloud Platform.
If you are not using Windows, you can change them using the following code
chmod a+x ./hookfile.sh
git add ./hookfile.sh
git commit -m 'Add execute bit to hookfile.sh'
git push
If you are using Windows, the command to change permissions is
git update-index --chmod=+x ./hookfile.sh