]> git.openstreetmap.org Git - rails.git/commit
Avoid string interpolation into bash commands
authorAndy Allan <git@gravitystorm.co.uk>
Tue, 12 May 2026 14:16:40 +0000 (15:16 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Tue, 12 May 2026 14:30:41 +0000 (15:30 +0100)
commit5628eb485c01e49f08ba7159696f991fcdcc9d80
treebceb91dbb7d8c04937541e26dc567bb8d1860ace
parent863d38bd981def348e209e63db9f7639ae7cc81c
Avoid string interpolation into bash commands

Although the `clone_url` and `sha` are safe, other similar aspects of
the pull request head are not (e.g. `head.ref`, `pull_request.title` etc)
and these must not be interpolated.

So let's use the convention of putting such data into environment
variables, where the contents are not interpolated into the bash
commands and are instead passed directly to the called program.

https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
.github/workflows/danger.yml