ci: update workflows [skip ci]

This commit is contained in:
lowlighter
2022-01-26 22:15:49 -05:00
parent 1e696052f5
commit 2aa933828f
3 changed files with 14 additions and 6 deletions

View File

@@ -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()

View File

@@ -1,7 +1,7 @@
name: Check automated branches
on:
pull_request:
pull_request_target:
branches:
- main
- latest

View File

@@ -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 }}