Specify a GitHub repository version with a reference and commit ID - AWS CodeBuild

Specify a GitHub repository version with a reference and commit ID

You can specify a source version with a reference and a commit ID in this format: refs/heads/branchname^{full-commit-SHA} (for example, refs/heads/main^{12345678901234567890123467890123456789}). If you do this, CodeBuild downloads only the specified branch to find the version.

To specify a GitHub repository version with a reference and commit ID.
  1. Complete the steps in Specify a GitHub repository version with a commit ID.

  2. From the left navigation pane, choose Build projects, and then choose the project you created earlier.

  3. Choose Start build.

  4. In Source version, enter refs/heads/main^{046e8b67481d53bdc86c3f6affdd5d1afae6d369}. This is the same commit ID and a reference to a branch in the format refs/heads/branchname^{full-commit-SHA}.

  5. Choose Start build.

  6. When the build is complete, you should see the following:

    • On the Build logs tab, which version of the project source was used. Here is an example.

      [Container] Date Time Running command echo $CODEBUILD_RESOLVED_SOURCE_VERSION 046e8b67481d53bdc86c3f6affdd5d1afae6d369 [Container] Date Time Phase complete: BUILD State: SUCCEEDED
    • On the Environment variables tab, the Resolved source version matches the commit ID used to create the build.

    • On the Phase details tab, the duration of the DOWNLOAD_SOURCE phase should be shorter than the duration when you used only the commit ID to specify the version of your source.

Warning Javascript is disabled or is unavailable in your browser.

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.

AltStyle によって変換されたページ (->オリジナル) /