Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the SC version configurable #17

Merged
merged 1 commit into from
Nov 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: github-action-tunnel
scVersion: 4.6.2
# ...
```

Expand Down Expand Up @@ -120,3 +121,6 @@ Don't automatically assign jobs to this tunnel. Jobs will use it only by explici

### `verbose`:
Enable verbose logging. Can be used up to two times. (default "true")

### `scVersion`:
Version of the saucelabs/sauce-connect docker image.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ inputs:
description: Enable verbose logging. Can be used up to two times.
required: false
default: "true"
scVersion:
description: Version of the saucelabs/sauce-connect docker image.
required: false
default: "4.6.2"
runs:
using: 'node12'
main: 'dist/main/index.js'
Expand Down
4 changes: 2 additions & 2 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,6 @@ const os_1 = __webpack_require__(87);
const fs_1 = __webpack_require__(747);
const wait_1 = __webpack_require__(259);
const option_mapping_json_1 = __importDefault(__webpack_require__(189));
const CONTAINER_VERSION = '4.6.2';
const LOG_FILE = '/srv/sauce-connect.log';
const PID_FILE = '/srv/sauce-connect.pid';
const READY_FILE = '/opt/sauce-connect-action/sc.ready';
Expand Down Expand Up @@ -1601,7 +1600,8 @@ function buildOptions() {
function run() {
return __awaiter(this, void 0, void 0, function* () {
const DIR_IN_HOST = yield fs_1.promises.mkdtemp(path_1.join(os_1.tmpdir(), `sauce-connect-action`));
const containerName = `saucelabs/sauce-connect:${CONTAINER_VERSION}`;
const containerVersion = core_1.getInput('scVersion');
const containerName = `saucelabs/sauce-connect:${containerVersion}`;
try {
yield exec_1.exec('docker', ['pull', containerName]);
let containerId = '';
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {promises} from 'fs'
import {wait} from './wait'
import optionMappingJson from './option-mapping.json'

const CONTAINER_VERSION = '4.6.2'
const LOG_FILE = '/srv/sauce-connect.log'
const PID_FILE = '/srv/sauce-connect.pid'
const READY_FILE = '/opt/sauce-connect-action/sc.ready'
Expand Down Expand Up @@ -48,7 +47,8 @@ async function run(): Promise<void> {
const DIR_IN_HOST = await promises.mkdtemp(
join(tmpdir(), `sauce-connect-action`)
)
const containerName = `saucelabs/sauce-connect:${CONTAINER_VERSION}`
const containerVersion = getInput('scVersion')
const containerName = `saucelabs/sauce-connect:${containerVersion}`
try {
await exec('docker', ['pull', containerName])
let containerId = ''
Expand Down