From 5353bc09d2aa22a54de71de310aa191996fca2a0 Mon Sep 17 00:00:00 2001 From: miverso2 Date: Fri, 4 Jun 2021 17:48:52 -0500 Subject: [PATCH] adding rubocop as a github action --- .github/workflows/rubocop-analysis.yml | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/rubocop-analysis.yml diff --git a/.github/workflows/rubocop-analysis.yml b/.github/workflows/rubocop-analysis.yml new file mode 100644 index 0000000..b9d222e --- /dev/null +++ b/.github/workflows/rubocop-analysis.yml @@ -0,0 +1,41 @@ +name: "Rubocop" + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '41 13 * * 4' + +jobs: + rubocop: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + - name: Install Code Scanning integration + run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install + + - name: Install dependencies + run: bundle install + + - name: Rubocop run + run: | + bash -c " + bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif + [[ $? -ne 2 ]] + " + + - name: Upload Sarif output + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: rubocop.sarif