Skip to content

Commit 9821256

Browse files
skryukovkamipo
andauthored
Do not create scan_js workflow on --skip-js (rails#53553)
* Do not create scan_js workflow on --skip-js * Update railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt Co-authored-by: Ryuta Kamizono <[email protected]> --------- Co-authored-by: Ryuta Kamizono <[email protected]>
1 parent 85acb96 commit 9821256

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: bin/brakeman --no-pager
2525

2626
<% end -%>
27-
<%- if options[:javascript] == "importmap" && !options[:api] -%>
27+
<%- if options[:javascript] == "importmap" && !options[:api] && !options[:skip_javascript] -%>
2828
scan_js:
2929
runs-on: ubuntu-latest
3030

railties/test/generators/api_app_generator_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def test_api_modified_files
6161
assert_file ".github/workflows/ci.yml" do |content|
6262
assert_no_match(/test:system/, content)
6363
assert_no_match(/screenshots/, content)
64+
assert_no_match(/scan_js/, content)
6465
end
6566
end
6667

railties/test/generators/app_generator_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,10 @@ def test_javascript_is_skipped_if_required
548548
assert_file "app/views/layouts/application.html.erb" do |contents|
549549
assert_match(/stylesheet_link_tag\s+:app %>/, contents)
550550
end
551+
552+
assert_file ".github/workflows/ci.yml" do |file|
553+
assert_no_match("scan_js", file)
554+
end
551555
end
552556

553557
def test_inclusion_of_jbuilder

0 commit comments

Comments
 (0)