diff --git a/action.yml b/action.yml index aafb3a99..839b1b50 100644 --- a/action.yml +++ b/action.yml @@ -106,6 +106,10 @@ inputs: Parameters must start with a hyphen (-) and may be followed by a value (without hyphen). Parameters without a value will be considered booleans (with a value of true). + chownFilesTo: + required: false + default: '' + description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts' allowDirtyBuild: required: false default: '' diff --git a/dist/index.js b/dist/index.js index 7b8c7e2b..ddf1a0e4 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index fb6a57de..f77a99a0 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/dist/steps/build.sh b/dist/steps/build.sh index 443d3a24..e7d1b439 100755 --- a/dist/steps/build.sh +++ b/dist/steps/build.sh @@ -143,6 +143,12 @@ if [[ "$BUILD_TARGET" == "StandaloneOSX" ]]; then chmod +x $ADD_PERMISSIONS_PATH fi + +if [[ -n "$CHOWN_FILES_TO" ]]; then + chown -R $CHOWN_FILES_TO $BUILD_PATH_FULL + chown -R $CHOWN_FILES_TO $UNITY_PROJECT_PATH +fi + # # Results # diff --git a/src/model/__mocks__/input.ts b/src/model/__mocks__/input.ts index 1cce57c4..87f6c91a 100644 --- a/src/model/__mocks__/input.ts +++ b/src/model/__mocks__/input.ts @@ -10,6 +10,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({ buildMethod: undefined, buildVersion: '1.3.37', customParameters: '', + chownFilesTo: '', }); export default { diff --git a/src/model/aws.ts b/src/model/aws.ts index 1bea09c0..fa6a8f4b 100644 --- a/src/model/aws.ts +++ b/src/model/aws.ts @@ -149,6 +149,10 @@ class AWS { name: 'CUSTOM_PARAMETERS', value: buildParameters.customParameters, }, + { + name: 'CHOWN_FILES_TO', + value: buildParameters.chownFilesTo, + }, { name: 'BUILD_TARGET', value: buildParameters.platform, diff --git a/src/model/build-parameters.ts b/src/model/build-parameters.ts index fe7122f3..3fd58b21 100644 --- a/src/model/build-parameters.ts +++ b/src/model/build-parameters.ts @@ -33,6 +33,7 @@ class BuildParameters { androidKeyaliasName: Input.androidKeyaliasName, androidKeyaliasPass: Input.androidKeyaliasPass, customParameters: Input.customParameters, + chownFilesTo: Input.chownFilesTo, remoteBuildCluster: Input.remoteBuildCluster, awsStackName: Input.awsStackName, kubeConfig: Input.kubeConfig, diff --git a/src/model/docker.ts b/src/model/docker.ts index f379f04c..7c39ce36 100644 --- a/src/model/docker.ts +++ b/src/model/docker.ts @@ -36,6 +36,7 @@ class Docker { androidKeyaliasName, androidKeyaliasPass, customParameters, + chownFilesTo, } = parameters; const command = `docker run \ @@ -62,6 +63,7 @@ class Docker { --env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \ --env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \ --env CUSTOM_PARAMETERS="${customParameters}" \ + --env CHOWN_FILES_TO="${chownFilesTo}" \ --env GITHUB_REF \ --env GITHUB_SHA \ --env GITHUB_REPOSITORY \ diff --git a/src/model/input.ts b/src/model/input.ts index c9ee2526..42f15489 100644 --- a/src/model/input.ts +++ b/src/model/input.ts @@ -85,6 +85,10 @@ class Input { return core.getInput('customParameters') || ''; } + static get chownFilesTo() { + return core.getInput('chownFilesTo') || ''; + } + static get remoteBuildCluster() { return core.getInput('remoteBuildCluster') || ''; } diff --git a/src/model/kubernetes.ts b/src/model/kubernetes.ts index 022ba1c7..1e31bb44 100644 --- a/src/model/kubernetes.ts +++ b/src/model/kubernetes.ts @@ -222,6 +222,10 @@ class Kubernetes { name: 'CUSTOM_PARAMETERS', value: this.buildParameters.customParameters, }, + { + name: 'CHOWN_FILES_TO', + value: this.buildParameters.chownFilesTo, + }, { name: 'BUILD_TARGET', value: this.buildParameters.platform,