CI fails with the code generated by Rails version >= 7.2.0
Steps to reproduce
Let's create a new Rails API application with the system configuration as mentioned:
rails new my_rails_app --api && cd my_rails_app
Adding files to a GitHub repo
git add . && git commit -m "initiate repo"
Create a new repository on GitHub and push all changes to it
git remote add origin git@github.com:JuzerShakir/my_rails_app.git
git branch -M main
git push -u origin main
After pushing the code to the repo, the CI gets triggered and runs the following jobs:
- scan_ruby
- scan_js
- lint
Expected behavior
Since this is an API-only application & doesn't generate assets, CSS, JS, etc, it should also not generate the scan_js
job. It should only generate the other 2 jobs:
- scan_ruby
- lint
When the code generated by the rails command is pushed to the remote repository w/o any modification by the user, it should pass all the tests.
Actual behavior
When the CI executes and runs the scan_js
job with the command bin/importmap audit
, it exits with the following error:
/home/runner/work/_temp/cf012b6b-5dcc-4bc8-aebb-75596782e7fe.sh: line 1: bin/importmap: No such file or directory
The error makes sense since Rails doesn't generate that file while initializing it as an API-only application.
System configuration
Rails version: 7.2.1
Ruby version: 3.3.1
If I could be assigned to resolve this issue, I would be very grateful! :)