Updated on 2023-11-22 GMT+08:00

Using GitHub for Build

  • By default, CodeArts Build pulls code from CodeArts Repo. For code hosted on GitHub, you can use a GitHub connection to pull the code.
  • You can use OAuth or access token authentication for the GitHub connection to restrict CodeArts Build from accessing the GitHub repository as long as code can be pulled to complete the build.

    You can also delete connections or withdraw authorization at any time to prevent password leakage.

Procedure

  1. Create a build task and select GitHub for Code Source. If you use the GitHub connection for the first time, create an endpoint instance first.
  2. Click Create next to Endpoint.
  3. In the Create Service Endpoint dialog box, select an authentication mode and set other parameters.

    • OAuth authentication
      Table 1 Parameters

      Parameter

      Description

      Service Endpoint Name

      Name of the service endpoint.

      Authentication Mode

      In OAuth authentication mode, you need to log in to GitHub for manual authorization.

    • Access token authentication

      Table 2 Parameters

      Parameter

      Description

      Service Endpoint Name

      Name of the service endpoint.

      Authentication Mode

      Access token authentication is used.

      Access Token

      Obtain the GitHub access token by referring to GitHub Access Token and enter the token here for authentication.

  4. Log in to GitHub.
  5. After the authorization is successful, return to the page for creating the build task.

    Update and select the endpoint. Select a code repository and code branch, and click Next to complete the subsequent configuration.