diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d56505522..9b6c65de2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -43,8 +43,11 @@ jobs: - name: Unlighthouse Assertions and Client run: unlighthouse-ci --site http://51.44.25.104/en --build-static --output-path .unlighthouse/dist + - name: Make convert_json_to_csv executable + run: chmod +x bin/convert_json_to_csv.rb + - name: Convert JSON to CSV - run: ruby lib/convert_json_to_csv.rb .unlighthouse/dist/ci-result.json .unlighthouse/dist/ci-result.csv + run: bin/convert_json_to_csv.rb .unlighthouse/dist/ci-result.json .unlighthouse/dist/ci-result.csv - name: Upload Unlighthouse Report uses: actions/upload-artifact@v4 diff --git a/app/lib/convert_json_to_csv.rb b/app/lib/convert_json_to_csv.rb index 7fae445aa..56cd32340 100644 --- a/app/lib/convert_json_to_csv.rb +++ b/app/lib/convert_json_to_csv.rb @@ -9,9 +9,3 @@ def self.perform(input_file, output_file) end end end - -if __FILE__ == $0 - input_file = ARGV[0] - output_file = ARGV[1] - ConvertJsonToCsv.perform(input_file, output_file) -end diff --git a/bin/convert_json_to_csv.rb b/bin/convert_json_to_csv.rb new file mode 100644 index 000000000..e244899ce --- /dev/null +++ b/bin/convert_json_to_csv.rb @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../lib/convert_json_to_csv" + +input_file = ARGV[0] +output_file = ARGV[1] +ConvertJsonToCsv.perform(input_file, output_file)