aws-codebuild-run-build icon indicating copy to clipboard operation
aws-codebuild-run-build copied to clipboard

Support Disabling Source Type Override Parameters

Open ejohn20 opened this issue 3 years ago • 6 comments

The source type override parameter is automatically overridden on the CodeBuild job to the GITHUB type and current repository. We have a scenario that requires our CodeBuild job to source from a different location, but would still like to drive the execution of the CodeBuild job from a GitHub action.

Can we add a new parameter that allows us to disable the source type override parameters and use the CodeBuild job's default values?

ejohn20 avatar Nov 02 '20 15:11 ejohn20

Adding another vote for this capability, we do not want the GitHub repository replicated to the CodeBuild job - we wish to manage this ourselves.

tomcavanaugh avatar Mar 04 '21 17:03 tomcavanaugh

Another vote, we would like to use this action to run already configured code build jobs.

dawidbladzich-ca avatar Apr 01 '21 14:04 dawidbladzich-ca

@robin-aws Is there any update on getting PR #64 reviewed?

cbuto avatar Jun 30 '21 16:06 cbuto

@robin-aws Our organization has a ton of use-cases for this enhancement (and the workaround is fairly painful). Any chance this gets reviewed anytime soon?

rathecharlesPFG avatar Sep 15 '21 20:09 rathecharlesPFG

We've simply forked this action and disabled these overrides, so we can use what is specified on the codebuild job.

diff --git a/code-build.js b/code-build.js
index 67d2e14..55be488 100644
--- a/code-build.js
+++ b/code-build.js
@@ -152,7 +152,7 @@ async function waitForBuildEndTime(
 
 function githubInputs() {
   const projectName = core.getInput("project-name", { required: true });
-  const { owner, repo } = github.context.repo;
+  // const { owner, repo } = github.context.repo;
   const { payload } = github.context;
   // The github.context.sha is evaluated on import.
   // This makes it hard to test.
@@ -177,8 +177,8 @@ function githubInputs() {
 
   return {
     projectName,
-    owner,
-    repo,
+    // owner,
+    // repo,
     sourceVersion,
     buildspecOverride,
     envPassthrough,
@@ -188,15 +188,15 @@ function githubInputs() {
 function inputs2Parameters(inputs) {
   const {
     projectName,
-    owner,
-    repo,
+    // owner,
+    // repo,
     sourceVersion,
     buildspecOverride,
     envPassthrough = [],
   } = inputs;
 
-  const sourceTypeOverride = "GITHUB";
-  const sourceLocationOverride = `https://github.com/${owner}/${repo}.git`;
+  // const sourceTypeOverride = "GITHUB";
+  // const sourceLocationOverride = `https://github.com/${owner}/${repo}.git`;
 
   const environmentVariablesOverride = Object.entries(process.env)
     .filter(
@@ -209,8 +209,8 @@ function inputs2Parameters(inputs) {
   return {
     projectName,
     sourceVersion,
-    sourceTypeOverride,
-    sourceLocationOverride,
+    // sourceTypeOverride,
+    // sourceLocationOverride,
     buildspecOverride,
     environmentVariablesOverride,
   };

sciurus avatar Dec 03 '21 21:12 sciurus

@ejohn20 You can try dark-mechanicum/aws-codebuild github action. By default, it does not pass anything but is very flexible in configuration. You literally can override any parameter for the startBuild API call ;)

akazakou avatar Jul 23 '22 11:07 akazakou