Skip to content

Commit

Permalink
remove saucelabs credentials (#3776)
Browse files Browse the repository at this point in the history
  • Loading branch information
HackbrettXXX authored Sep 25, 2024
1 parent f3c69ad commit 812fc78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Continous Integration
name: Continuous Integration

on: [push, pull_request]
on: [pull_request_target]

jobs:
test-saucelabs:
Expand Down
4 changes: 0 additions & 4 deletions .sauce.yml

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"jasmine": "3.5.0",
"jasmine-core": "3.5.0",
"jasmine-expect": "4.0.3",
"js-yaml": "3.13.1",
"jsdoc": "^3.6.3",
"karma": "5.1.0",
"karma-babel-preprocessor": "8.0.1",
Expand Down
17 changes: 6 additions & 11 deletions test/saucelabs/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Karma configuration
"use strict";
const yaml = require("js-yaml");
const fs = require("fs");
const karmaConfig = require("../karma.common.conf.js");

const browsers = {
Expand All @@ -25,24 +23,21 @@ const browsers = {
};

module.exports = config => {
// Use ENV vars or .sauce.yml to get credentials
// re-defining the env variables seems to fix the auth issue
// eslint-disable-next-line no-self-assign
process.env.SAUCE_USERNAME = process.env.SAUCE_USERNAME
// eslint-disable-next-line no-self-assign
process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY
if (
!(
process.env.SAUCE_USERNAME &&
process.env.SAUCE_ACCESS_KEY &&
process.env.SAUCE_ACCESS_KEY.length > 5
)
) {
if (!fs.existsSync(".sauce.yml")) {
// eslint-disable-next-line no-console
console.log("Create a .sauce.yml with your credentials");
console.error("Saucelabs credentials are missing. Define the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables.");
process.exit(1);
} else {
let sauceConfig = yaml.safeLoad(fs.readFileSync(".sauce.yml", "utf8"));
process.env.SAUCE_USERNAME = sauceConfig.addons.sauce_connect.username;
process.env.SAUCE_ACCESS_KEY =
sauceConfig.addons.sauce_connect.access_key;
}
}
config.set({
...karmaConfig,
Expand Down

0 comments on commit 812fc78

Please sign in to comment.