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

Cannot rerun build from GitHub checks if build fail or stuck

Open syazwanz opened this issue 2 years ago • 2 comments

Before opening, please confirm:

  • [X] I have checked to see if my question is addressed in the FAQ.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [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.

App Id

d2kkwvuxfk7x4k

AWS Region

ap-southeast-1

Amplify Hosting feature

Deployments, Frontend builds, Git providers

Describe the bug

I am hosting a create-react-app in amplify, and connected it to my repo in GitHub and enable PR Previews.

Sometimes when the build fail or get stuck, GitHub checks did not received any feedback from Amplify that the build has failed. The status in GitHub will continue to show -> In Progress - This check has started

I tried to rerun the amplify build from GitHub checks but it did not trigger a new build from amplify.

If I try manually to re-build from the Amplify itself, it did not send the new build message to GitHub checks. The checks status in GitHub will always points to the previous failed build.

The only way for me to overcome this is by manually do a dummy commit to the PR so that it can trigger back the build.

I hope there are more seamless options to do this.

Expected behavior

  • If the build fail, my GitHub checks will get a message from Amplify and check status will be updated in my GitHub.
  • I can rerun the build from my GitHub PR checks.
  • If I trigger the build manually from Amplify, it can also update the status build in my GitHub PR checks.

Reproduction steps

  1. Create a PR to merge feature branch to main branch.
  2. If the build fail or get stuck (unresponsive), go to GitHub PR Checks and try to rerun the checks (build). It did not trigger the rebuild.
  3. Manually go to Amplify console -> Preview -> Specific PR, try to click Redeploy this version, it will rebuild the app but it will not change the build/check status in GitHub PR Checks.

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Log output

# Put your logs below this line


Additional information

Screenshot 2023-01-24 at 3 49 51 PM Screenshot 2023-01-24 at 3 50 58 PM

syazwanz avatar Jan 24 '23 15:01 syazwanz

Hi @syazwanz 👋 , thanks for raising this and for sharing detailed information about the issue.

If the build fail, my GitHub checks will get a message from Amplify and check status will be updated in my GitHub.

During my testing, when the amplify build failed the corresponding GitHub check also failed: Screenshot 2023-09-07 at 8 02 36 AM

Are you able to actively reproduce this?

I can rerun the build from my GitHub PR checks.

This workflow/feature is currently not supported with web previews.

If I trigger the build manually from Amplify, it can also update the status build in my GitHub PR checks.

For this particular scenario, if you push a new commit which will successfully build and deploy in Amplify, the corresponding GitHub PR checks will then get updated and pass. I was able to test this behavior. Are you observing otherwise?

Jay2113 avatar Sep 07 '23 16:09 Jay2113

Could this be fixed it is kinda of annoying to push an empty commit just for the deployment to rerun.

Sytten avatar Jul 10 '25 02:07 Sytten