Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyong-ty authored Jan 31, 2024
2 parents 620558a + f9d5a15 commit 7992656
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ The only required input is `project-name`.
1. **disable-source-override** (optional) :
Set to `true` if you want to disable providing `sourceVersion`,
`sourceTypeOverride` and `sourceLocationOverride` to CodeBuild.
1. **source-version-override** (optional) :
The source version that overrides the `sourceVersion` provided to Codebuild.
1. **env-vars-for-codebuild** (optional) :
A comma-separated list of the names of environment variables
that the action passes from GitHub Actions to CodeBuild.
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ inputs:
disable-source-override:
description: 'Set to `true` if you want do disable source repo override'
required: false
source-version-override:
description: 'The source version that overrides the sourceVersion provided to Codebuild.'
required: false
hide-cloudwatch-logs:
description: 'Set to `true` to prevent the CloudWatch logs from streaming the output to GitHub'
required: false
Expand Down
5 changes: 3 additions & 2 deletions code-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ function githubInputs() {
// the GITHUB_SHA value is NOT the correct value.
// See: https://github.com/aws-actions/aws-codebuild-run-build/issues/36
const sourceVersion =
process.env[`GITHUB_EVENT_NAME`] === "pull_request"
core.getInput("source-version-override", { required: false }) ||
(process.env[`GITHUB_EVENT_NAME`] === "pull_request"
? (((payload || {}).pull_request || {}).head || {}).sha
: process.env[`GITHUB_SHA`];
: process.env[`GITHUB_SHA`]);

assert(sourceVersion, "No source version could be evaluated.");
const buildspecOverride =
Expand Down
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ function githubInputs() {
// the GITHUB_SHA value is NOT the correct value.
// See: https://github.com/aws-actions/aws-codebuild-run-build/issues/36
const sourceVersion =
process.env[`GITHUB_EVENT_NAME`] === "pull_request"
core.getInput("source-version-override", { required: false }) ||
(process.env[`GITHUB_EVENT_NAME`] === "pull_request"
? (((payload || {}).pull_request || {}).head || {}).sha
: process.env[`GITHUB_SHA`];
: process.env[`GITHUB_SHA`]);

assert(sourceVersion, "No source version could be evaluated.");
const buildspecOverride =
Expand Down

0 comments on commit 7992656

Please sign in to comment.