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 __presets = paths.join(__metrics, ".presets")
|
||||
|
||||
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 })
|
||||
if ((!await fs.access(__presets).then(_ => true).catch(_ => false)) || (!(await fs.lstat(__presets)).isDirectory())) {
|
||||
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)
|
||||
await git.pull()
|
||||
const staged = new Set()
|
||||
|
||||
2
.github/workflows/branches.yml
vendored
2
.github/workflows/branches.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Check automated branches
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- main
|
||||
- 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:
|
||||
pull_request:
|
||||
branches: [ presets ]
|
||||
workflow_call:
|
||||
inputs:
|
||||
HEAD_REF:
|
||||
ref:
|
||||
type: string
|
||||
repo:
|
||||
type: string
|
||||
jobs:
|
||||
|
||||
@@ -27,4 +29,5 @@ jobs:
|
||||
- name: Run tests
|
||||
run: npm run test-presets
|
||||
env:
|
||||
HEAD_REF: ${{ inputs.HEAD_REF }}
|
||||
HEAD_REF: ${{ inputs.ref }}
|
||||
REPO: ${{ inputs.repo }}
|
||||
Reference in New Issue
Block a user