amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

pre-build-function hook does not invoke on push

Open ykethan opened this issue 1 year ago • 3 comments

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.0.3

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

Describe the bug

According to https://docs.amplify.aws/cli/project/command-hooks/#how-to-name-command-hook-scripts, amplify CLI supports hook for pre build function hooks. When running amplify build function this works as expected but when running push which does also run function build does not invoke the hook

Expected behavior

run function hooks

Reproduction steps

  1. create sample function
  2. create a sample hook with a simple console log
  3. run amplify function build to verify the hook runs
  4. then run amplify push

observe the hook does not invoke

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

ykethan avatar Jun 06 '23 02:06 ykethan

It would be great to have a fix for this. Is there a recommended workaround in the meantime?

martoncsikos avatar Dec 20 '23 15:12 martoncsikos

Hi 👋 @martoncsikos

Could you confirm the version? Is that 12.0.3 or 12.10.3? Have you happened to try 12.10.2 as well?

0618 avatar Mar 07 '24 19:03 0618

Hi 👋 @martoncsikos

Could you confirm the version? Is that 12.0.3 or 12.10.3? Have you happened to try 12.10.2 as well?

We ended up moving away from using hooks because of this. I did a quick test now. We were on 12.8.2, this was still happening. 12.10.1 is currently the latest, I upgraded to it, still there. I also tried 12.10.2, still there.

Can you point me to what was released that was meant to fix it please?

martoncsikos avatar Mar 08 '24 08:03 martoncsikos