From 79832c07870d9bd3f0112b9cad403d6927081110 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Fri, 17 Nov 2023 21:57:51 +0100 Subject: [PATCH] Add rubocop to pipeline --- .github/workflows/test.yml | 11 ++++++++++- .tool-versions | 1 + action.yml | 1 + bin/gitlab_pipeline_action.rb | 0 release.rb | 11 +++++++---- 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .tool-versions mode change 100644 => 100755 bin/gitlab_pipeline_action.rb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 68e290a..6f57dc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Run Integration test +name: Run Tests on: push: @@ -32,3 +32,12 @@ jobs: - run: docker compose down if: always() working-directory: test + + rubocop: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + - run: bundle install + - run: bundle exec rubocop diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..f2a971a --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 3.2.2 diff --git a/action.yml b/action.yml index df26899..3d55a1b 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,7 @@ inputs: description: 'A runner token, if a runner should be started in this action' GL_API_TOKEN: description: 'A token to check the pipeline status with. Required if the project is private' + required: true author: 'Taucher2003' runs: using: 'docker' diff --git a/bin/gitlab_pipeline_action.rb b/bin/gitlab_pipeline_action.rb old mode 100644 new mode 100755 diff --git a/release.rb b/release.rb index 1b5509b..9e2f1af 100755 --- a/release.rb +++ b/release.rb @@ -1,21 +1,24 @@ #!/usr/bin/env ruby +# frozen_string_literal: true version = ARGV.shift readme = File.read 'README.md' -readme_for_version = readme.gsub("Taucher2003/GitLab-Pipeline-Action@", "Taucher2003/GitLab-Pipeline-Action@#{version}") +readme_for_version = readme.gsub('Taucher2003/GitLab-Pipeline-Action@', + "Taucher2003/GitLab-Pipeline-Action@#{version}") File.write 'README.md', readme_for_version action = File.read 'action.yml' -action_for_version = action.gsub(" image: 'Dockerfile'", " image: 'ghcr.io/taucher2003/gitlab-pipeline-action:#{version}'") +action_for_version = action.gsub(" image: 'Dockerfile'", + " image: 'ghcr.io/taucher2003/gitlab-pipeline-action:#{version}'") File.write 'action.yml', action_for_version -system("git add README.md action.yml") +system('git add README.md action.yml') system("git commit -m 'Create release for #{version}'") system("git tag #{version}") File.write 'README.md', readme File.write 'action.yml', action -system("git add README.md action.yml") +system('git add README.md action.yml') system("git commit -m 'Reset action to development version'")