Skip to content

Commit e6d3dae

Browse files
authored
revert Fix file ownership issues for self-hosted runners. (#141) (#165)
1 parent ef74241 commit e6d3dae

File tree

5 files changed

+4
-30
lines changed

5 files changed

+4
-30
lines changed

action/Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
ARG IMAGE
22
FROM $IMAGE
33

4-
ARG UNAME=runner
5-
ARG UID=1000
6-
ARG GID=1000
7-
84
LABEL "com.github.actions.name"="Unity - Builder"
95
LABEL "com.github.actions.description"="Build Unity projects for different platforms."
106
LABEL "com.github.actions.icon"="box"
@@ -14,15 +10,9 @@ LABEL "repository"="http://github.com/webbertakken/unity-actions"
1410
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
1511
LABEL "maintainer"="Webber Takken <webber@takken.io>"
1612

17-
RUN bash -c 'mkdir -p /github/{home,workflow,workspace}' && chown $UID:$GID -R /github/
18-
RUN getent group $GID || groupadd -g $GID $UNAME
19-
RUN id -u $UID &>/dev/null || useradd -m -u $UID -g $GID -s /bin/bash -d /github/home $UNAME
20-
2113
ADD default-build-script /UnityBuilderAction
2214
ADD steps /steps
2315
RUN chmod -R +x /steps
2416
ADD entrypoint.sh /entrypoint.sh
2517
RUN chmod +x /entrypoint.sh
2618
ENTRYPOINT ["/entrypoint.sh"]
27-
28-
USER $UID:$GID

action/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ async function action() {
1616
} else {
1717
// Build docker image
1818
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
19-
const builtImage = await Docker.build({
20-
path: actionFolder,
21-
dockerfile,
22-
baseImage,
23-
uid: buildParameters.uid,
24-
gid: buildParameters.gid,
25-
});
19+
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
2620
await Docker.run(builtImage, { workspace, ...buildParameters });
2721
}
2822

src/model/build-parameters.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os from 'os';
21
import AndroidVersioning from './android-versioning';
32
import Input from './input';
43
import Platform from './platform';
@@ -21,13 +20,10 @@ class BuildParameters {
2120
Input.androidVersionCode,
2221
);
2322

24-
const { uid, gid } = os.userInfo();
25-
2623
return {
2724
version: Input.unityVersion,
2825
customImage: Input.customImage,
29-
uid,
30-
gid,
26+
3127
runnerTempPath: process.env.RUNNER_TEMP,
3228
platform: Input.targetPlatform,
3329
projectPath: Input.projectPath,

src/model/docker.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import fs from 'fs';
21
import { exec } from '@actions/exec';
32
import ImageTag from './image-tag';
43

54
class Docker {
65
static async build(buildParameters, silent = false) {
7-
const { path, dockerfile, baseImage, uid, gid } = buildParameters;
6+
const { path, dockerfile, baseImage } = buildParameters;
87
const { version, platform } = baseImage;
98

109
const tag = new ImageTag({ repository: '', name: 'unity-builder', version, platform });
1110
const command = `docker build ${path} \
1211
--file ${dockerfile} \
1312
--build-arg IMAGE=${baseImage} \
14-
--build-arg UID=${uid} \
15-
--build-arg GID=${gid} \
1613
--tag ${tag}`;
1714

1815
await exec(command, undefined, { silent });
@@ -86,9 +83,6 @@ class Docker {
8683
--volume "${workspace}":"/github/workspace" \
8784
${image}`;
8885

89-
fs.mkdirSync(`${runnerTempPath}/_github_home`, { recursive: true });
90-
fs.mkdirSync(`${runnerTempPath}/_github_workflow`, { recursive: true });
91-
9286
await exec(command, undefined, { silent });
9387
}
9488
}

0 commit comments

Comments
 (0)