Skip to content

Commit

Permalink
Force creation of GitHub Actions CI workflow
Browse files Browse the repository at this point in the history
Since we switched to using `.yml` for YAML files in #1246, generating
the CI config would clash and request the user intervene. We force the
template to overwrite instead.

Completes #1243.
  • Loading branch information
nickcharlton committed Feb 17, 2025
1 parent 271a110 commit 76dc99e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/generators/suspenders/ci_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class CiGenerator < Rails::Generators::Base
MARKDOWN

def ci_files
empty_directory ".github/workflows"
template "ci.yml", ".github/workflows/ci.yml"
template "ci.yml", ".github/workflows/ci.yml", force: true
end

private
Expand Down
3 changes: 3 additions & 0 deletions test/generators/suspenders/ci_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class CiGeneratorTest < Rails::Generators::TestCase
teardown :restore_destination

test "generates CI files" do
mkdir(".github/workflows")
touch(".github/workflows/ci.yml")

with_database "postgresql" do
run_generator

Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def remove_dir_if_exists(dir)
def mkdir(dir)
path = app_root dir

FileUtils.mkdir path
FileUtils.mkdir_p path
end

def touch(file, **options)
Expand Down

0 comments on commit 76dc99e

Please sign in to comment.