From 70fc0a589793dde23ccf84e21628f894f46bbc0c Mon Sep 17 00:00:00 2001 From: Kris Date: Sun, 4 Feb 2024 20:58:30 -0500 Subject: [PATCH] try actions --- .github/workflows/main.yml | 76 ++++++++++++++++++++++++++++ app/views/suggestions/_form.html.erb | 4 +- config/environments/production.rb | 4 +- 3 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a79357f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,76 @@ +name: CI + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + test: + # services: + # db: + # image: postgres:11 + # ports: ['5432:5432'] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1.45.0 + with: + ruby-version: 2.7.1 + + - uses: Borales/actions-yarn@v2.3.0 + with: + cmd: install + + - name: Install Dependencies + run: | + # sudo apt install -yqq libpq-dev + gem install bundler + + - name: Install Gems + run: | + bundle install + + - name: Prepare Database + run: | + bundle exec rails db:prepare + + - name: Run Tests + # env: + # DATABASE_URL: postgres://postgres:@localhost:5432/databasename + # RAILS_MASTER_KEY: ${{secrets.RAILS_MASTER_KEY}} + run: | + bundle exec rails test + + - name: Create Coverage Artifact + uses: actions/upload-artifact@v2 + with: + name: code-coverage + path: coverage/ + + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1.45.0 + with: + ruby-version: 2.7.1 + + - name: Install Brakeman + run: | + gem install brakeman + + - name: Run Brakeman + run: | + brakeman -f json > tmp/brakeman.json || exit 0 + + - name: Brakeman Report + uses: devmasx/brakeman-linter-action@v1.0.0 + env: + REPORT_PATH: tmp/brakeman.json + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/app/views/suggestions/_form.html.erb b/app/views/suggestions/_form.html.erb index a75eee6..c63155d 100644 --- a/app/views/suggestions/_form.html.erb +++ b/app/views/suggestions/_form.html.erb @@ -14,13 +14,13 @@
<%= form.text_field :subject, class: "form-control" %> - <%= form.label :subject, style: "display: block" %> + <%= form.label :subject %>

<%= form.text_area :body, class: "form-control", style: "height: 100px" %> - <%= form.label :body, style: "display: block" %> + <%= form.label :body %>
diff --git a/config/environments/production.rb b/config/environments/production.rb index 2aabf99..0d85488 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,7 +49,9 @@ Rails.application.configure do # config.assume_ssl = true # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true + + #default is true + config.force_ssl = false # Log to STDOUT by default config.logger = ActiveSupport::Logger.new(STDOUT)