forked from AstroNvim/AstroNvim
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·35 lines (33 loc) · 1.28 KB
/
updater.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Updater Comment
on:
pull_request_target:
paths: ["**.lua"]
types: ["opened"]
jobs:
updater-comment:
name: Comment updater settings
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const src = context.payload.pull_request.head
const user = src.user.login
const tab = " "
let settings = tab + "updater = {\n" + tab + tab + `channel = "nightly",\n`
if (src.ref != "nightly") {
settings += tab + tab + `branch = "${src.ref}",\n`
}
if (user != "AstroNvim") {
settings += tab + tab + `remote = "${user}",\n`
settings += tab + tab + `remotes = {\n`
settings += tab + tab + tab + `["${user}"] = "${user}/${src.repo.name}",\n`
settings += tab + tab + `},\n`
}
settings += tab + "},"
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Use the following `updater` settings in your `user/init.lua` file, restart, and run `:AstroUpdate` to test this pull request:\n```\n" + settings + "\n```",
})