diff --git a/.github/workflows/Semgrep.yml b/.github/workflows/Semgrep.yml new file mode 100644 index 0000000..0347afd --- /dev/null +++ b/.github/workflows/Semgrep.yml @@ -0,0 +1,48 @@ +# Name of this GitHub Actions workflow. +name: Semgrep + +on: + # Scan changed files in PRs (diff-aware scanning): + # The branches below must be a subset of the branches above + pull_request: + branches: ["master", "main"] + push: + branches: ["master", "main"] + schedule: + - cron: '0 6 * * *' + + +permissions: + contents: read + +jobs: + semgrep: + # User definable name of this GitHub Actions job. + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + name: semgrep/ci + # If you are self-hosting, change the following `runs-on` value: + runs-on: ubuntu-latest + + container: + # A Docker image with Semgrep installed. Do not change this. + image: returntocorp/semgrep + + # Skip any PR created by dependabot to avoid permission issues: + if: (github.actor != 'dependabot[bot]') + + steps: + # Fetch project source with GitHub Actions Checkout. + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + # Run the "semgrep ci" command on the command line of the docker image. + - run: semgrep ci --sarif --output=semgrep.sarif + env: + # Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable. + SEMGREP_RULES: p/default # more at semgrep.dev/explore + + - name: Upload SARIF file for GitHub Advanced Security Dashboard + uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.20.0 + with: + sarif_file: semgrep.sarif + if: always() \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 83cfc2b..109f97d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - yyyy-mm-dd -## [1.4.1] - 2023-02-06 +## [ +1.4.3] - 2023-08-24 -### Fixed -Stop API in case of multiple instances on same machine +### Changed +Ruby 3 exists? deprecation fix diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..ddd85cc --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @browserstack/local-dev diff --git a/browserstack-local.gemspec b/browserstack-local.gemspec index 9fa2746..9d1a650 100644 --- a/browserstack-local.gemspec +++ b/browserstack-local.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'browserstack-local' - s.version = '1.4.1' - s.date = '2023-02-06' + s.version = '1.4.3' + s.date = '2023-08-24' s.summary = "BrowserStack Local" s.description = "Ruby bindings for BrowserStack Local" s.authors = ["BrowserStack"] diff --git a/lib/browserstack/localbinary.rb b/lib/browserstack/localbinary.rb index d3231e2..cab3f92 100644 --- a/lib/browserstack/localbinary.rb +++ b/lib/browserstack/localbinary.rb @@ -13,16 +13,16 @@ def initialize @http_path = case host_os when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ @windows = true - "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal.exe" + "https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal.exe" when /darwin|mac os/ - "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-darwin-x64" + "https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-darwin-x64" when /linux-musl/ - "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-alpine" + "https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-alpine" when /linux/ if 1.size == 8 - "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-x64" + "https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-x64" else - "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-ia32" + "https://www.browserstack.com/local-testing/downloads/binaries/BrowserStackLocal-linux-ia32" end end @@ -34,7 +34,7 @@ def initialize end def download(dest_parent_dir) - unless File.exists? dest_parent_dir + unless File.exist? dest_parent_dir Dir.mkdir dest_parent_dir end uri = URI.parse(@http_path) @@ -63,7 +63,7 @@ def binary_path dest_parent_dir = get_available_dirs binary_path = File.join(dest_parent_dir, "BrowserStackLocal#{".exe" if @windows}") - if File.exists? binary_path + if File.exist? binary_path binary_path else binary_path = download(dest_parent_dir)