How to use GitHub Action with AWS CodeBuild ?

· 22 min read
How to use GitHub Action with AWS CodeBuild ?

With the release of GitHub Action support, AWS CodeBuild has expanded its scope of possibilities. You can leverage pre-built actions or third-party solutions available in GitHub’s marketplace. There is no additional cost for running GitHub Action Runner.

What is GitHub Action?

"Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow" -- https://docs.github.com/en/actions

In this post, we'll use an action runner to run GitHub Action (Super-Linter) with an AWS CodeBuild to find code quality issues (e.g. naming conventions, spacing, formatting etc.) in the sample Java project.

GitHubActionTest.java

package com.awsjunkie.codebuild;

public class GitHubActionTest {
	private static final String text = "asgaG";
	public static void main(String[] args) {System.out.println("GitHub Action Test...");}
	
	private void METHODNAME() {}
}

Youtube Shorts:

Create CodeBuild Project:

Open AWS CodeBuild and start creating CodeBuild project.

Type project name (e.g. aws-codebuild-github-action-test).

Source:

Select "Source provider".  For the demo I'll use my GitHub source repo (aws-codebuild-github-action).

Other source providers will work too. But it is advisable to connect to GitHub source provider for GitHub Action. Otherwise, downloading of Docker action container may get rate-limited due to anonymous access.

Environment :

Select AWS CodeBuild environment image.

Select the "Privileged" checkbox ("Enable this flag if you want to build Docker images or want your builds to get elevated privileges.").

Without privileged mode enabled, GitHub docker container action will fail.

AWS CodeBuild - GitHub Actions: COMMAND_EXECUTION_ERROR Message: Error while executing command | [error]Docker pull failed with exit code 1
For GitHub Docker container actions, “build project must have privileged mode enabled and be run by the default Docker user (root).” Otherwise, build will fail with following error logs. [Container] 2023/07/11 02:09:11 Entering phase PRE_BUILD[Container] 2023/07/11 02:09:11 Preparing action comma…

Buildspec:

Sample code project contains buildspec.yml file. By default, CodeBuild will pick the file named buildspec.yml from source code's root directory.

Super-Linter GitHub Action is added as steps to pre_build phase in the buildspec file.

buildspec.yml

version: 0.2
phases:
  pre_build:
    steps:
      - name: Lint Code Base
        uses: github/super-linter@v4
        env:
          VALIDATE_ALL_CODEBASE: 'true'
          DEFAULT_BRANCH: main

Artifacts:

As we have introduced errors (related to code quality) in code, GitHub Action (Super-Linter) will find it and fail the build. So, there will not be any artifacts for this demo. So, we can skip this step.

Finally, click "Create build project".

Start Build:

Start the build.  Soon, Super-Linter GitHub Action will find all code quality issues and build will fail with message "Exiting with errors found!"

Complete Logs:

[Container] 2023/07/18 21:08:16 Waiting for agent ping
[Container] 2023/07/18 21:08:17 Waiting for DOWNLOAD_SOURCE
[Container] 2023/07/18 21:08:20 Phase is DOWNLOAD_SOURCE
[Container] 2023/07/18 21:08:21 CODEBUILD_SRC_DIR=/codebuild/output/src2146946882/src/github.com/awsjunkie/aws-codebuild-github-action
[Container] 2023/07/18 21:08:21 YAML location is /codebuild/output/src2146946882/src/github.com/awsjunkie/aws-codebuild-github-action/buildspec.yml
[Container] 2023/07/18 21:08:21 No commands found for phase name: pre_build
[Container] 2023/07/18 21:08:21 Downloading Action Runner
[Container] 2023/07/18 21:08:31 Setting HTTP client timeout to higher timeout for Github and GitHub Enterprise sources
[Container] 2023/07/18 21:08:31 Processing environment variables
[Container] 2023/07/18 21:08:31 No runtime version selected in buildspec.
[Container] 2023/07/18 21:08:31 Moving to directory /codebuild/output/src2146946882/src/github.com/awsjunkie/aws-codebuild-github-action
[Container] 2023/07/18 21:08:31 Configuring ssm agent with target id: codebuild:6aea3e4e-a3ff-43bc-a9e4-916886024194
[Container] 2023/07/18 21:08:31 Successfully updated ssm agent configuration
[Container] 2023/07/18 21:08:31 Registering with agent
[Container] 2023/07/18 21:08:31 Phases found in YAML: 1
[Container] 2023/07/18 21:08:31  PRE_BUILD: 1 steps
[Container] 2023/07/18 21:08:31 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2023/07/18 21:08:31 Phase context status code:  Message: 
[Container] 2023/07/18 21:08:31 Entering phase INSTALL
[Container] 2023/07/18 21:08:31 Phase complete: INSTALL State: SUCCEEDED
[Container] 2023/07/18 21:08:31 Phase context status code:  Message: 
[Container] 2023/07/18 21:08:31 Entering phase PRE_BUILD
[Container] 2023/07/18 21:08:31 Preparing action command
[Container] 2023/07/18 21:08:32 Current runner version: '2.304.0'
[Container] 2023/07/18 21:08:33 Preparing the runtime environment
[Container] 2023/07/18 21:08:35 /usr/local/bin/docker pull ghcr.io/github/super-linter:v4.10.0
[Container] 2023/07/18 21:08:35 v4.10.0: Pulling from github/super-linter
[Container] 2023/07/18 21:08:35 c158987b0551: Pulling fs layer
[Container] 2023/07/18 21:08:35 b225ab37e4b4: Pulling fs layer
[Container] 2023/07/18 21:08:35 c88c80b6e377: Pulling fs layer
[Container] 2023/07/18 21:08:35 2e7ecbda2d78: Pulling fs layer
[Container] 2023/07/18 21:08:35 a094d268b2a2: Pulling fs layer
[Container] 2023/07/18 21:08:35 439105f3f292: Pulling fs layer
[Container] 2023/07/18 21:08:35 8230ea6b5617: Pulling fs layer
[Container] 2023/07/18 21:08:35 f2565199863c: Pulling fs layer
[Container] 2023/07/18 21:08:35 aebf6746c5b4: Pulling fs layer
[Container] 2023/07/18 21:08:35 a09219d53d41: Pulling fs layer
[Container] 2023/07/18 21:08:35 fced99825fe0: Pulling fs layer
[Container] 2023/07/18 21:08:35 090edde53d4c: Pulling fs layer
[Container] 2023/07/18 21:08:35 700edc275bc9: Pulling fs layer
[Container] 2023/07/18 21:08:35 276cbf39bb76: Pulling fs layer
[Container] 2023/07/18 21:08:35 81e952a70a02: Pulling fs layer
[Container] 2023/07/18 21:08:35 d8204cadd360: Pulling fs layer
[Container] 2023/07/18 21:08:35 18f2e4b66b5a: Pulling fs layer
[Container] 2023/07/18 21:08:35 769fd4b7e223: Pulling fs layer
[Container] 2023/07/18 21:08:35 0334da32ef7a: Pulling fs layer
[Container] 2023/07/18 21:08:35 94d062269ddf: Pulling fs layer
[Container] 2023/07/18 21:08:35 10cab8f62f02: Pulling fs layer
[Container] 2023/07/18 21:08:35 b2d8104c3fa2: Pulling fs layer
[Container] 2023/07/18 21:08:35 0e48af19f2f8: Pulling fs layer
[Container] 2023/07/18 21:08:35 5e32222e29a7: Pulling fs layer
[Container] 2023/07/18 21:08:35 ce4d374719cb: Pulling fs layer
[Container] 2023/07/18 21:08:35 ce2e2092ff93: Pulling fs layer
[Container] 2023/07/18 21:08:35 f7a93ea6427c: Pulling fs layer
[Container] 2023/07/18 21:08:35 e6e31c11a945: Pulling fs layer
[Container] 2023/07/18 21:08:35 2e7ecbda2d78: Waiting
[Container] 2023/07/18 21:08:35 a094d268b2a2: Waiting
[Container] 2023/07/18 21:08:35 439105f3f292: Waiting
[Container] 2023/07/18 21:08:35 8230ea6b5617: Waiting
[Container] 2023/07/18 21:08:35 f2565199863c: Waiting
[Container] 2023/07/18 21:08:35 aebf6746c5b4: Waiting
[Container] 2023/07/18 21:08:35 a09219d53d41: Waiting
[Container] 2023/07/18 21:08:35 fced99825fe0: Waiting
[Container] 2023/07/18 21:08:35 090edde53d4c: Waiting
[Container] 2023/07/18 21:08:35 700edc275bc9: Waiting
[Container] 2023/07/18 21:08:35 276cbf39bb76: Waiting
[Container] 2023/07/18 21:08:35 81e952a70a02: Waiting
[Container] 2023/07/18 21:08:35 d8204cadd360: Waiting
[Container] 2023/07/18 21:08:35 18f2e4b66b5a: Waiting
[Container] 2023/07/18 21:08:35 769fd4b7e223: Waiting
[Container] 2023/07/18 21:08:35 0334da32ef7a: Waiting
[Container] 2023/07/18 21:08:35 94d062269ddf: Waiting
[Container] 2023/07/18 21:08:35 10cab8f62f02: Waiting
[Container] 2023/07/18 21:08:35 b2d8104c3fa2: Waiting
[Container] 2023/07/18 21:08:35 0e48af19f2f8: Waiting
[Container] 2023/07/18 21:08:35 5e32222e29a7: Waiting
[Container] 2023/07/18 21:08:35 ce4d374719cb: Waiting
[Container] 2023/07/18 21:08:35 ce2e2092ff93: Waiting
[Container] 2023/07/18 21:08:35 f7a93ea6427c: Waiting
[Container] 2023/07/18 21:08:35 e6e31c11a945: Waiting
[Container] 2023/07/18 21:08:36 b225ab37e4b4: Verifying Checksum
[Container] 2023/07/18 21:08:36 b225ab37e4b4: Download complete
[Container] 2023/07/18 21:08:36 c158987b0551: Verifying Checksum
[Container] 2023/07/18 21:08:36 c158987b0551: Download complete
[Container] 2023/07/18 21:08:36 2e7ecbda2d78: Verifying Checksum
[Container] 2023/07/18 21:08:36 2e7ecbda2d78: Download complete
[Container] 2023/07/18 21:08:36 c88c80b6e377: Verifying Checksum
[Container] 2023/07/18 21:08:36 c88c80b6e377: Download complete
[Container] 2023/07/18 21:08:36 c158987b0551: Pull complete
[Container] 2023/07/18 21:08:36 439105f3f292: Verifying Checksum
[Container] 2023/07/18 21:08:36 439105f3f292: Download complete
[Container] 2023/07/18 21:08:36 b225ab37e4b4: Pull complete
[Container] 2023/07/18 21:08:36 8230ea6b5617: Verifying Checksum
[Container] 2023/07/18 21:08:36 8230ea6b5617: Download complete
[Container] 2023/07/18 21:08:36 f2565199863c: Verifying Checksum
[Container] 2023/07/18 21:08:36 f2565199863c: Download complete
[Container] 2023/07/18 21:08:37 aebf6746c5b4: Verifying Checksum
[Container] 2023/07/18 21:08:37 aebf6746c5b4: Download complete
[Container] 2023/07/18 21:08:37 fced99825fe0: Verifying Checksum
[Container] 2023/07/18 21:08:37 fced99825fe0: Download complete
[Container] 2023/07/18 21:08:38 090edde53d4c: Verifying Checksum
[Container] 2023/07/18 21:08:38 090edde53d4c: Download complete
[Container] 2023/07/18 21:08:38 700edc275bc9: Verifying Checksum
[Container] 2023/07/18 21:08:38 700edc275bc9: Download complete
[Container] 2023/07/18 21:08:39 276cbf39bb76: Verifying Checksum
[Container] 2023/07/18 21:08:39 276cbf39bb76: Download complete
[Container] 2023/07/18 21:08:39 c88c80b6e377: Pull complete
[Container] 2023/07/18 21:08:39 2e7ecbda2d78: Pull complete
[Container] 2023/07/18 21:08:40 81e952a70a02: Verifying Checksum
[Container] 2023/07/18 21:08:40 81e952a70a02: Download complete
[Container] 2023/07/18 21:08:41 d8204cadd360: Verifying Checksum
[Container] 2023/07/18 21:08:41 d8204cadd360: Download complete
[Container] 2023/07/18 21:08:41 a094d268b2a2: Verifying Checksum
[Container] 2023/07/18 21:08:41 a094d268b2a2: Download complete
[Container] 2023/07/18 21:08:41 18f2e4b66b5a: Verifying Checksum
[Container] 2023/07/18 21:08:41 18f2e4b66b5a: Download complete
[Container] 2023/07/18 21:08:42 0334da32ef7a: Verifying Checksum
[Container] 2023/07/18 21:08:42 0334da32ef7a: Download complete
[Container] 2023/07/18 21:08:42 94d062269ddf: Verifying Checksum
[Container] 2023/07/18 21:08:42 94d062269ddf: Download complete
[Container] 2023/07/18 21:08:43 769fd4b7e223: Verifying Checksum
[Container] 2023/07/18 21:08:43 769fd4b7e223: Download complete
[Container] 2023/07/18 21:08:44 b2d8104c3fa2: Verifying Checksum
[Container] 2023/07/18 21:08:44 b2d8104c3fa2: Download complete
[Container] 2023/07/18 21:08:44 a09219d53d41: Download complete
[Container] 2023/07/18 21:08:44 0e48af19f2f8: Verifying Checksum
[Container] 2023/07/18 21:08:44 0e48af19f2f8: Download complete
[Container] 2023/07/18 21:08:44 10cab8f62f02: Verifying Checksum
[Container] 2023/07/18 21:08:44 10cab8f62f02: Download complete
[Container] 2023/07/18 21:08:45 ce2e2092ff93: Verifying Checksum
[Container] 2023/07/18 21:08:45 ce2e2092ff93: Download complete
[Container] 2023/07/18 21:08:46 f7a93ea6427c: Verifying Checksum
[Container] 2023/07/18 21:08:46 f7a93ea6427c: Download complete
[Container] 2023/07/18 21:08:46 e6e31c11a945: Verifying Checksum
[Container] 2023/07/18 21:08:46 e6e31c11a945: Download complete
[Container] 2023/07/18 21:08:47 5e32222e29a7: Verifying Checksum
[Container] 2023/07/18 21:08:47 5e32222e29a7: Download complete
[Container] 2023/07/18 21:08:48 ce4d374719cb: Verifying Checksum
[Container] 2023/07/18 21:08:48 ce4d374719cb: Download complete
[Container] 2023/07/18 21:08:58 a094d268b2a2: Pull complete
[Container] 2023/07/18 21:08:58 439105f3f292: Pull complete
[Container] 2023/07/18 21:08:59 8230ea6b5617: Pull complete
[Container] 2023/07/18 21:08:59 f2565199863c: Pull complete
[Container] 2023/07/18 21:08:59 aebf6746c5b4: Pull complete
[Container] 2023/07/18 21:09:21 a09219d53d41: Pull complete
[Container] 2023/07/18 21:09:22 fced99825fe0: Pull complete
[Container] 2023/07/18 21:09:23 090edde53d4c: Pull complete
[Container] 2023/07/18 21:09:23 700edc275bc9: Pull complete
[Container] 2023/07/18 21:09:23 276cbf39bb76: Pull complete
[Container] 2023/07/18 21:09:28 81e952a70a02: Pull complete
[Container] 2023/07/18 21:09:29 d8204cadd360: Pull complete
[Container] 2023/07/18 21:09:30 18f2e4b66b5a: Pull complete
[Container] 2023/07/18 21:09:39 769fd4b7e223: Pull complete
[Container] 2023/07/18 21:09:39 0334da32ef7a: Pull complete
[Container] 2023/07/18 21:09:39 94d062269ddf: Pull complete
[Container] 2023/07/18 21:09:41 10cab8f62f02: Pull complete
[Container] 2023/07/18 21:09:41 b2d8104c3fa2: Pull complete
[Container] 2023/07/18 21:09:42 0e48af19f2f8: Pull complete
[Container] 2023/07/18 21:09:49 5e32222e29a7: Pull complete
[Container] 2023/07/18 21:10:04 ce4d374719cb: Pull complete
[Container] 2023/07/18 21:10:08 ce2e2092ff93: Pull complete
[Container] 2023/07/18 21:10:08 f7a93ea6427c: Pull complete
[Container] 2023/07/18 21:10:08 e6e31c11a945: Pull complete
[Container] 2023/07/18 21:10:08 Digest: sha256:4e04df5a4f8fd76cd16dd17a07f015a33e5964ca07c48184fc1a163e10dd737b
[Container] 2023/07/18 21:10:08 Status: Downloaded newer image for ghcr.io/github/super-linter:v4.10.0
[Container] 2023/07/18 21:10:08 ghcr.io/github/super-linter:v4.10.0
[Container] 2023/07/18 21:10:08 Run github/super-linter@v4
[Container] 2023/07/18 21:10:08 env:
[Container] 2023/07/18 21:10:08   DEFAULT_BRANCH: main
[Container] 2023/07/18 21:10:08   VALIDATE_ALL_CODEBASE: true
[Container] 2023/07/18 21:10:08 /usr/local/bin/docker run --name ghcriogithubsuperlinterv4100_bb5b2f --label 1f8c8b --workdir /github/workspace --rm -e "DEFAULT_BRANCH" -e "VALIDATE_ALL_CODEBASE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_EVENT_NAME" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e GITHUB_ACTIONS=true -e AWS_CONTAINER_CREDENTIALS_FULL_URI -e AWS_CONTAINER_CREDENTIALS_RELATIVE_URI -e AWS_REGION -e CI=true --network host -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/codebuild/readonly/action-runner/_layout/_work/_temp/_github_home":"/github/home" -v "/codebuild/readonly/action-runner/_layout/_work/_temp/_github_workflow":"/github/workflow" -v "/codebuild/readonly/action-runner/_layout/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/codebuild/readonly/action-runner/_layout/_work/aws-codebuild-github-action.git/aws-codebuild-github-action.git":"/github/workspace" ghcr.io/github/super-linter:v4.10.0
[Container] 2023/07/18 21:10:10 --------------------------------------------------------------------------------
[Container] 2023/07/18 21:10:10 
[Container] 2023/07/18 21:10:10                               /@@#///////@@/(@//@%/(@.@(       @@
[Container] 2023/07/18 21:10:10                           @@//////////////////////////////#*  @@@
[Container] 2023/07/18 21:10:10                         @////@//(///////////@@@@@///@//@/@**//@@(
[Container] 2023/07/18 21:10:10                       @///////@///////////////@@@@    (           @,
[Container] 2023/07/18 21:10:10                      @/(&/@////////////////////                     @
[Container] 2023/07/18 21:10:10                     @////////////////////////@@                      @
[Container] 2023/07/18 21:10:10                   @%////////(//////////%/////&@            @@       *,@           ______________
[Container] 2023/07/18 21:10:10              @@@@@/@/#/////(&//////////////////                       .@         /              \
[Container] 2023/07/18 21:10:10         *@@@@@.    .%///(//@//////////////////&.   .@@,                 @%      / Don't mind me  \
[Container] 2023/07/18 21:10:10       @@%           .&@&&/@.@//&/////(//////////    @@@@@@@@@         .. &@    / I'm just looking \
[Container] 2023/07/18 21:10:10     @@%               @@@@@   @&/////////////////#   @/       V  @@/ ,@@@ @   <  for some trash... |
[Container] 2023/07/18 21:10:10 @@@%                   @@@@        .%@@@@//////#@ @   @@         @     .,.     \__________________/
[Container] 2023/07/18 21:10:10                                           @@@/@(  (@@@@% @/\      %
[Container] 2023/07/18 21:10:10                                            @@@@(    .     .@@/\   #
[Container] 2023/07/18 21:10:10                                              @                  %@%
[Container] 2023/07/18 21:10:10 
[Container] 2023/07/18 21:10:10 --------------------------------------------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   ---------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   --- GitHub Actions Multi Language Linter ----
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]    - Image Creation Date:[2023-01-04T06:45:30Z]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]    - Image Revision:[d2600eb1bd51e68b2c065501b241c450be01a216]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]    - Image Version:[d2600eb1bd51e68b2c065501b241c450be01a216]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   ---------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   ---------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   The Super-Linter source code can be found at:
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]    - https://github.com/github/super-linter
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   ---------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   --------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Gathering GitHub information...
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Successfully found:[GITHUB_SHA], value:[default]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Successfully found:[GITHUB_WORKSPACE], value:[/github/workspace]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Successfully found:[GITHUB_EVENT_PATH], value:[/github/workflow/event.json]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Successfully found:[GITHUB_ORG], value:[null]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Successfully found:[GITHUB_REPO], value:[null]
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [ERROR]   Failed to get [GITHUB_TOKEN]!
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [ERROR]   []
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [ERROR]   Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   --------------------------------------------
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   Gathering user validation information...
[Container] 2023/07/18 21:10:10 2023-07-18 21:10:10 [INFO]   - Validating ALL files in code base...
[Container] 2023/07/18 21:10:13 2023-07-18 21:10:13 [INFO]   ---------------------------------
[Container] 2023/07/18 21:10:13 2023-07-18 21:10:13 [INFO]   ------ File list to check: ------
[Container] 2023/07/18 21:10:13 2023-07-18 21:10:13 [INFO]   ---------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   Successfully gathered list of files...
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   Linting [GITLEAKS] files...
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   File:[/github/workspace/buildspec.yml]
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]    - File:[buildspec.yml] was linted with [gitleaks] successfully
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]      - Command output:
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14     ○
[Container] 2023/07/18 21:10:14     │╲
[Container] 2023/07/18 21:10:14     │ ○
[Container] 2023/07/18 21:10:14     ○ ░
[Container] 2023/07/18 21:10:14     ░    gitleaks
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14 9:10PM INF scan completed in 10.6ms
[Container] 2023/07/18 21:10:14 9:10PM INF no leaks found
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   File:[/github/workspace/pom.xml]
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]    - File:[pom.xml] was linted with [gitleaks] successfully
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]      - Command output:
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14     ○
[Container] 2023/07/18 21:10:14     │╲
[Container] 2023/07/18 21:10:14     │ ○
[Container] 2023/07/18 21:10:14     ○ ░
[Container] 2023/07/18 21:10:14     ░    gitleaks
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14 9:10PM INF scan completed in 9.74ms
[Container] 2023/07/18 21:10:14 9:10PM INF no leaks found
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   File:[/github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java]
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]    - File:[GitHubActionTest.java] was linted with [gitleaks] successfully
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]      - Command output:
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14     ○
[Container] 2023/07/18 21:10:14     │╲
[Container] 2023/07/18 21:10:14     │ ○
[Container] 2023/07/18 21:10:14     ○ ░
[Container] 2023/07/18 21:10:14     ░    gitleaks
[Container] 2023/07/18 21:10:14 
[Container] 2023/07/18 21:10:14 9:10PM INF scan completed in 10.8ms
[Container] 2023/07/18 21:10:14 9:10PM INF no leaks found
[Container] 2023/07/18 21:10:14 ------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   Linting [GOOGLE_JAVA_FORMAT] files...
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:14 2023-07-18 21:10:14 [INFO]   File:[/github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java]
[Container] 2023/07/18 21:10:15 2023-07-18 21:10:15 [INFO]    - File:[GitHubActionTest.java] was linted with [google-java-format] successfully
[Container] 2023/07/18 21:10:15 2023-07-18 21:10:15 [INFO]      - Command output:
[Container] 2023/07/18 21:10:15 ------
[Container] 2023/07/18 21:10:15 package com.awsjunkie.codebuild;
[Container] 2023/07/18 21:10:15 
[Container] 2023/07/18 21:10:15 public class GitHubActionTest {
[Container] 2023/07/18 21:10:15   private static final String text = "asgaG";
[Container] 2023/07/18 21:10:15 
[Container] 2023/07/18 21:10:15   public static void main(String[] args) {
[Container] 2023/07/18 21:10:15     System.out.println("GitHub Action Test...");
[Container] 2023/07/18 21:10:15   }
[Container] 2023/07/18 21:10:15 
[Container] 2023/07/18 21:10:15   private void METHODNAME() {}
[Container] 2023/07/18 21:10:15 }
[Container] 2023/07/18 21:10:15 ------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   Linting [JAVA] files...
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:16 2023-07-18 21:10:16 [INFO]   File:[/github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java]
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [ERROR]   Found errors in [checkstyle] linter!
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [ERROR]   Error code: 14. Command output:
[Container] 2023/07/18 21:10:17 ------
[Container] 2023/07/18 21:10:17 Starting audit...
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:1: Missing package-info.java file. [JavadocPackage]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:4:1: File contains tab characters (this is the first instance). [FileTabCharacter]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:4:9: Missing a Javadoc comment. [JavadocVariable]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:4:37: Name 'text' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5: Line is longer than 80 characters (found 93). [LineLength]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5:33: Parameter args should be final. [FinalParameters]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5:48: '{' at column 41 should have line break after. [LeftCurly]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5:48: '{' is not followed by whitespace. [WhitespaceAround]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5:92: ';' is not followed by whitespace. [WhitespaceAfter]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:5:93: '}' is not preceded with whitespace. [WhitespaceAround]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:6: Line has trailing spaces. [RegexpSingleline]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:7:22: Name 'METHODNAME' must match pattern '^[a-z][a-zA-Z0-9]*$'. [MethodName]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:7:35: '{' is not followed by whitespace. [WhitespaceAround]
[Container] 2023/07/18 21:10:17 [ERROR] /github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java:7:36: '}' is not preceded with whitespace. [WhitespaceAround]
[Container] 2023/07/18 21:10:17 Audit done.
[Container] 2023/07/18 21:10:17 Checkstyle ends with 14 errors.
[Container] 2023/07/18 21:10:17 ------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   Linting [JSCPD] files...
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:17 2023-07-18 21:10:17 [INFO]   File:[/github/workspace/buildspec.yml]
[Container] 2023/07/18 21:10:18 2023-07-18 21:10:18 [INFO]    - File:[buildspec.yml] was linted with [jscpd] successfully
[Container] 2023/07/18 21:10:18 2023-07-18 21:10:18 [INFO]      - Command output:
[Container] 2023/07/18 21:10:18 ------
[Container] 2023/07/18 21:10:18 Found 0 clones.
[Container] 2023/07/18 21:10:18 Detection time:: 8.751ms
[Container] 2023/07/18 21:10:18 ------
[Container] 2023/07/18 21:10:18 2023-07-18 21:10:18 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:18 2023-07-18 21:10:18 [INFO]   File:[/github/workspace/pom.xml]
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]    - File:[pom.xml] was linted with [jscpd] successfully
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]      - Command output:
[Container] 2023/07/18 21:10:19 ------
[Container] 2023/07/18 21:10:19 Found 0 clones.
[Container] 2023/07/18 21:10:19 Detection time:: 11.341ms
[Container] 2023/07/18 21:10:19 ------
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]   File:[/github/workspace/src/main/java/com/awsjunkie/codebuild/GitHubActionTest.java]
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]    - File:[GitHubActionTest.java] was linted with [jscpd] successfully
[Container] 2023/07/18 21:10:19 2023-07-18 21:10:19 [INFO]      - Command output:
[Container] 2023/07/18 21:10:19 ------
[Container] 2023/07/18 21:10:19 Found 0 clones.
[Container] 2023/07/18 21:10:19 Detection time:: 10.084ms
[Container] 2023/07/18 21:10:19 ------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   Linting [XML] files...
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   File:[/github/workspace/pom.xml]
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]    - File:[pom.xml] was linted with [xmllint] successfully
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]      - Command output:
[Container] 2023/07/18 21:10:21 ------
[Container] 2023/07/18 21:10:21 <?xml version="1.0"?>
[Container] 2023/07/18 21:10:21 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
[Container] 2023/07/18 21:10:21   <modelVersion>4.0.0</modelVersion>
[Container] 2023/07/18 21:10:21   <groupId>com.awsjunkie</groupId>
[Container] 2023/07/18 21:10:21   <artifactId>aws-codebuild</artifactId>
[Container] 2023/07/18 21:10:21   <version>0.0.1-SNAPSHOT</version>
[Container] 2023/07/18 21:10:21   <name>GitHubAction</name>
[Container] 2023/07/18 21:10:21 </project>
[Container] 2023/07/18 21:10:21 ------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   Linting [YAML] files...
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ---------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   File:[/github/workspace/buildspec.yml]
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [ERROR]   Found errors in [yamllint] linter!
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [ERROR]   Error code: 1. Command output:
[Container] 2023/07/18 21:10:21 ------
[Container] 2023/07/18 21:10:21 /github/workspace/buildspec.yml:1:1: [warning] missing document start "---" (document-start)
[Container] 2023/07/18 21:10:21 /github/workspace/buildspec.yml:1:13: [error] wrong new line character: expected 
[Container] 2023/07/18 21:10:21  (new-lines)
[Container] 2023/07/18 21:10:21 ------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   The script has completed
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [INFO]   ----------------------------------------------
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [ERROR]   ERRORS FOUND in JAVA:[1]
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [ERROR]   ERRORS FOUND in YAML:[1]
[Container] 2023/07/18 21:10:21 2023-07-18 21:10:21 [FATAL]   Exiting with errors found!

[Container] 2023/07/18 21:10:21 Command failed with exit status 2
[Container] 2023/07/18 21:10:21 Phase complete: PRE_BUILD State: FAILED
[Container] 2023/07/18 21:10:21 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: - name: Lint Code Base
  uses: github/super-linter@v4
  env:
    DEFAULT_BRANCH: main
    VALIDATE_ALL_CODEBASE: "true"
. Reason: exit status 2

References