Skip to content

Commit e09ab50

Browse files
ysangkokandreasabel
authored andcommitted
Add hints on Renovate usage
1 parent 2f031e6 commit e09ab50

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/examples.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,40 @@ jobs:
188188

189189
Alternatively, the two occurrences of `--disable-documentation` can be changed to `--enable-documentation`, for resolving the external references to the documentation of the dependencies.
190190
This will increase build times a bit, though.
191+
192+
### Dependency updates
193+
194+
You can use [Renovate](https://www.mend.io/renovate/) to detect
195+
if dependencies do not allow the latest version.
196+
197+
If you install [the Renovate Github app](https://github.com/apps/renovate), it
198+
will submit a PR with configuration to your repository.
199+
200+
The following option can be added to that PR. It embeds new dependency versions in a
201+
[git trailer](https://alchemists.io/articles/git_trailers):
202+
203+
```
204+
"commitBody": "New-Versions:\n{{#each upgrades}} {{{depName}}}=={{{newVersion}}}\n{{/each}}"
205+
```
206+
207+
These new versions can then be saved to `cabal.project` in a workflow step.
208+
Insert the following before the `cabal configure` step:
209+
210+
```
211+
- name: Extract New-Versions git trailer from Renovate
212+
if: ${{ github.event_name == "pull_request" }}
213+
run: |
214+
if [ ! -f cabal.project ]
215+
then echo "packages: ." > cabal.project
216+
fi
217+
for constraint in $(git log "--format=%(trailers:key=New-Versions,valueonly=true)" ${{ github.event.pull_request.head.sha }} -1)
218+
do echo "constraints: $constraint" >> cabal.project
219+
done
220+
```
221+
222+
Note that a Cabal constraint can't change the version of GHC used. So you may
223+
want to add [ignoreDeps](https://docs.renovatebot.com/configuration-options/#ignoredeps)
224+
to ignore updates for [boot libraries](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history).
225+
226+
You can also enable [osvVulnerabilityAlerts](https://docs.renovatebot.com/configuration-options/#osvvulnerabilityalerts) to receive
227+
alerts from the [Haskell Security Advisory Database](https://haskell.github.io/security-advisories/).

0 commit comments

Comments
 (0)