Skip to content

Commit

Permalink
Merge pull request #77 from saucelabs/dans-save-state
Browse files Browse the repository at this point in the history
Resolves #61
  • Loading branch information
waggledans authored Apr 6, 2023
2 parents 6212e84 + 7df244f commit 270345f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Changed
- update to Sauce Connect `v4.9.0`
- resolves #61

## [2.3.2] - 2023-01-26
### Changed
Expand Down
6 changes: 5 additions & 1 deletion dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5189,6 +5189,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core_1 = __webpack_require__(186);
const installer_1 = __webpack_require__(574);
const start_sc_1 = __webpack_require__(820);
const fs_1 = __webpack_require__(747);
const retryDelays = [1, 1, 1, 2, 3, 4, 5, 10, 20, 40, 60].map(a => a * 1000);
function run() {
return __awaiter(this, void 0, void 0, function* () {
Expand All @@ -5199,7 +5200,10 @@ function run() {
for (let i = 0;; i++) {
try {
const pid = yield start_sc_1.startSc();
core_1.saveState('scPid', pid);
const githubState = process.env.GITHUB_STATE || '/tmp/github_state';
fs_1.appendFileSync(githubState, `scPid=${pid}`, {
encoding: 'utf8'
});
return;
}
catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "Christian Bromann <christian@saucelabs.com>",
"version": "1.1.3",
"version": "2.3.4",
"license": "MIT",
"homepage": "https://github.com/saucelabs/sauce-connect-action#readme",
"bugs": {
Expand Down
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {getInput, saveState, setFailed, warning} from '@actions/core'
import {getInput, setFailed, warning} from '@actions/core'
import {installSauceConnect} from './installer'
import {startSc} from './start-sc'
import {appendFileSync} from 'fs'

const retryDelays = [1, 1, 1, 2, 3, 4, 5, 10, 20, 40, 60].map(a => a * 1000)

Expand All @@ -14,7 +15,10 @@ async function run(): Promise<void> {
for (let i = 0; ; i++) {
try {
const pid = await startSc()
saveState('scPid', pid)
const githubState = process.env.GITHUB_STATE || '/tmp/github_state'
appendFileSync(githubState, `scPid=${pid}`, {
encoding: 'utf8'
})
return
} catch (e) {
if (Date.now() - startTime >= retryTimeout) {
Expand Down

0 comments on commit 270345f

Please sign in to comment.