Skip to content

Commit 5c3abaa

Browse files
justin808claude
andcommitted
Fix CI failures on master and add workflow_dispatch to all workflows
This commit addresses two critical CI issues: 1. **Fix generator validation failing in CI**: - The rake task that generates example apps was calling `rails generate` as a shell command, which spawned a new process without the REACT_ON_RAILS_SKIP_VALIDATION environment variable set - Modified shakapacker_examples.rake to prefix generator commands with the ENV variable so validation is skipped during npm package installation - This resolves the "No React on Rails npm package is installed" error that was breaking the examples workflow on master 2. **Add workflow_dispatch to all CI workflows**: - Added workflow_dispatch trigger to enable manual workflow runs on any branch via GitHub Actions UI - This makes CI testing more flexible and allows developers to test changes on feature branches without needing to open a PR - Updated workflows: main.yml, lint-js-and-ruby.yml, rspec-package-specs.yml, package-js-tests.yml, pro-integration-tests.yml, pro-package-tests.yml, pro-lint.yml The generator validation fix complements the existing skip logic added in PR #1923 which only handled direct generator invocations, not shell command invocations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fd23d07 commit 5c3abaa

File tree

8 files changed

+12
-1
lines changed

8 files changed

+12
-1
lines changed

.github/workflows/lint-js-and-ruby.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
paths-ignore:
1212
- '**.md'
1313
- 'docs/**'
14+
workflow_dispatch:
1415

1516
jobs:
1617
detect-changes:

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
paths-ignore:
1212
- '**.md'
1313
- 'docs/**'
14+
workflow_dispatch:
1415

1516
jobs:
1617
detect-changes:

.github/workflows/package-js-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- 'docs/**'
1616
- 'lib/**'
1717
- 'spec/react_on_rails/**'
18+
workflow_dispatch:
1819

1920
jobs:
2021
detect-changes:

.github/workflows/pro-integration-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- 'master'
77
pull_request:
8+
workflow_dispatch:
89

910
defaults:
1011
run:

.github/workflows/pro-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- 'master'
77
pull_request:
8+
workflow_dispatch:
89

910
defaults:
1011
run:

.github/workflows/pro-package-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- 'master'
77
pull_request:
8+
workflow_dispatch:
89

910
defaults:
1011
run:

.github/workflows/rspec-package-specs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- 'docs/**'
1616
- 'packages/react-on-rails/src/**'
1717
- 'node_package/src/**'
18+
workflow_dispatch:
1819

1920
jobs:
2021
detect-changes:

rakelib/shakapacker_examples.rake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength
3737
sh_in_dir(example_type.dir, "echo \"gem 'shakapacker', '>= 8.2.0'\" >> #{example_type.gemfile}")
3838
bundle_install_in(example_type.dir)
3939
sh_in_dir(example_type.dir, "rake shakapacker:install")
40-
sh_in_dir(example_type.dir, example_type.generator_shell_commands)
40+
# Set ENV variable to skip validation during generator run since npm package isn't installed yet
41+
generator_commands = example_type.generator_shell_commands.map do |cmd|
42+
"REACT_ON_RAILS_SKIP_VALIDATION=true #{cmd}"
43+
end
44+
sh_in_dir(example_type.dir, generator_commands)
4145
sh_in_dir(example_type.dir, "yarn")
4246
end
4347
end

0 commit comments

Comments
 (0)