ci: add renovate-post
This commit is contained in:
parent
6ae55b82b0
commit
9975ab9a01
3 changed files with 81 additions and 0 deletions
6
.github/scripts/render-dhall-changes.sh
vendored
Executable file
6
.github/scripts/render-dhall-changes.sh
vendored
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
for file in .github/workflows/*.dhall; do
|
||||
nix shell nixpkgs#dhall-yaml -c dhall-to-yaml-ng --file "$file" >"${file%.dhall}.yml"
|
||||
done
|
48
.github/workflows/renovate-post.dhall
vendored
Normal file
48
.github/workflows/renovate-post.dhall
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
let GithubActions =
|
||||
https://github.com/regadas/github-actions-dhall/raw/master/package.dhall
|
||||
sha256:9c1ae46a1d56f1c22dbc9006cbb3e569806e75d02fded38fa102935b34980395
|
||||
|
||||
let permissions =
|
||||
Some
|
||||
[ { mapKey = GithubActions.types.Permission.contents
|
||||
, mapValue = GithubActions.types.PermissionAccess.write
|
||||
}
|
||||
]
|
||||
|
||||
let steps =
|
||||
[ GithubActions.Step::{ uses = Some "actions/checkout@v4" }
|
||||
, GithubActions.Step::{
|
||||
, uses = Some "DeterminateSystems/nix-installer-action@v11"
|
||||
}
|
||||
, GithubActions.Step::{
|
||||
, run = Some ../scripts/render-dhall-changes.sh as Text
|
||||
}
|
||||
, GithubActions.Step::{
|
||||
, uses = Some "EndBug/add-and-commit@v9.1.4"
|
||||
, `with` = Some
|
||||
( toMap
|
||||
{ message = "Render Dhall changes"
|
||||
, author_name = "renovate[bot]"
|
||||
, author_email =
|
||||
"<29139614+renovate[bot]@users.noreply.github.com>"
|
||||
}
|
||||
)
|
||||
}
|
||||
]
|
||||
|
||||
let render_dhall_changes =
|
||||
GithubActions.Job::{
|
||||
, name = Some "Render Dhall changes"
|
||||
, runs-on = GithubActions.RunsOn.Type.ubuntu-latest
|
||||
, `if` = Some "\${{github.actor == 'renovate[bot]'}}"
|
||||
, permissions
|
||||
, steps
|
||||
}
|
||||
|
||||
in GithubActions.Workflow::{
|
||||
, name = "renovate-post"
|
||||
, on = GithubActions.On::{
|
||||
, push = Some GithubActions.Push::{ branches = Some [ "renovate/*" ] }
|
||||
}
|
||||
, jobs = toMap { render_dhall_changes }
|
||||
}
|
27
.github/workflows/renovate-post.yml
vendored
Normal file
27
.github/workflows/renovate-post.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
jobs:
|
||||
render_dhall_changes:
|
||||
if: "${{github.actor == 'renovate[bot]'}}"
|
||||
name: Render Dhall changes
|
||||
permissions:
|
||||
contents: write
|
||||
"runs-on": "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v4"
|
||||
- uses: "DeterminateSystems/nix-installer-action@v11"
|
||||
- run: |
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
for file in .github/workflows/*.dhall; do
|
||||
nix shell nixpkgs#dhall-yaml -c dhall-to-yaml-ng --file "$file" >"${file%.dhall}.yml"
|
||||
done
|
||||
- uses: "EndBug/add-and-commit@v9.1.4"
|
||||
with:
|
||||
author_email: "<29139614+renovate[bot]@users.noreply.github.com>"
|
||||
author_name: "renovate[bot]"
|
||||
message: Render Dhall changes
|
||||
name: "renovate-post"
|
||||
'on':
|
||||
push:
|
||||
branches:
|
||||
- "renovate/*"
|
Loading…
Reference in a new issue