ci: update workflows [skip ci]
This commit is contained in:
9
.github/scripts/presets_examples.mjs
vendored
9
.github/scripts/presets_examples.mjs
vendored
@@ -14,8 +14,13 @@ console.log(`Mode: ${mode}`)
|
|||||||
const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..")
|
const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..")
|
||||||
const __presets = paths.join(__metrics, ".presets")
|
const __presets = paths.join(__metrics, ".presets")
|
||||||
|
|
||||||
if ((!await fs.access(__presets).then(_ => true).catch(_ => false)) || (!(await fs.lstat(__presets)).isDirectory()))
|
if ((!await fs.access(__presets).then(_ => true).catch(_ => false)) || (!(await fs.lstat(__presets)).isDirectory())) {
|
||||||
await sgit().clone(`https://github-actions[bot]:${process.env.GITHUB_TOKEN}@github.com/lowlighter/metrics`, __presets, { "--branch": process.env.HEAD_REF || "presets", "--single-branch": true })
|
let {HEAD_REF:branch, REPO:repo} = process.env
|
||||||
|
branch = branch || "presets"
|
||||||
|
repo = repo || "lowlighter/metrics"
|
||||||
|
console.log(`cloning: ${repo}@${branch}`)
|
||||||
|
await sgit().clone(`https://github-actions[bot]:${process.env.GITHUB_TOKEN}@github.com/${repo}`, __presets, { "--branch": branch, "--single-branch": true })
|
||||||
|
}
|
||||||
const git = sgit(__presets)
|
const git = sgit(__presets)
|
||||||
await git.pull()
|
await git.pull()
|
||||||
const staged = new Set()
|
const staged = new Set()
|
||||||
|
|||||||
2
.github/workflows/branches.yml
vendored
2
.github/workflows/branches.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Check automated branches
|
name: Check automated branches
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- latest
|
- latest
|
||||||
|
|||||||
9
.github/workflows/test.presets.yml
vendored
9
.github/workflows/test.presets.yml
vendored
@@ -1,11 +1,13 @@
|
|||||||
name: Test
|
name: Test (presets)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ presets ]
|
branches: [ presets ]
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
HEAD_REF:
|
ref:
|
||||||
|
type: string
|
||||||
|
repo:
|
||||||
type: string
|
type: string
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -27,4 +29,5 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test-presets
|
run: npm run test-presets
|
||||||
env:
|
env:
|
||||||
HEAD_REF: ${{ inputs.HEAD_REF }}
|
HEAD_REF: ${{ inputs.ref }}
|
||||||
|
REPO: ${{ inputs.repo }}
|
||||||
Reference in New Issue
Block a user