Skip to content

Commit f0f0a81

Browse files
stevepolitodesignrafaelfranca
authored andcommitted
CI: Introduce RAILS_MASTER_KEY placeholder
Improves existing CI templates by adding an [environment variable][ev] to store the `RAILS_MASTER_KEY` which should be stored as a [secret][]. This is necessary when [`config.require_master_key`][crmk] is enabled, or when using [custom credentials][cc]. Since those features are not enabled by default, we comment this value out, which is consistent with how we treat Redis. [ev]: https://docs.github.com/en/actions/learn-github-actions/variables [secret]: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions [crmk]: https://guides.rubyonrails.org/configuring.html#config-require-master-key [cc]: https://guides.rubyonrails.org/security.html#custom-credentials
1 parent 1719d25 commit f0f0a81

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

railties/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Introduce `RAILS_MASTER_KEY` placeholder in generated ci.yml files
2+
3+
*Steve Polito*
4+
15
* Colorize the Rails console prompt even on non standard environments.
26

37
*Lorenzo Zabot*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ jobs:
127127
<%- elsif options[:database] == "postgresql" -%>
128128
DATABASE_URL: postgres://postgres:postgres@localhost:5432
129129
<%- end -%>
130+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
130131
# REDIS_URL: redis://localhost:6379/0
131132
<%- if options[:api] || options[:skip_system_test] -%>
132133
run: bin/rails db:test:prepare test

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
<%- elsif options[:database] == "postgresql" -%>
9292
DATABASE_URL: postgres://postgres:postgres@localhost:5432
9393
<%- end -%>
94+
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
9495
# REDIS_URL: redis://localhost:6379/0
9596
run: <%= test_command %>
9697

0 commit comments

Comments
 (0)