From 6d3b03a71ebb48480dc635630795a842faf6e2a9 Mon Sep 17 00:00:00 2001 From: ZhengJin Date: Wed, 20 Sep 2023 17:40:21 +0800 Subject: [PATCH] test --- .github/scripts/run-build.js | 2 +- .github/scripts/runtime.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/run-build.js b/.github/scripts/run-build.js index f3c8fc3..c86c864 100644 --- a/.github/scripts/run-build.js +++ b/.github/scripts/run-build.js @@ -2,7 +2,7 @@ module.exports = async (scripts) => { const { github, context, core, glob, io, exec, fetch, require } = scripts; const package = RegExp(`^packages/(?

[\\w-]+)$`, 'gm').exec(context.payload.label.name).groups['p']; - const version = RegExp(`^${package}-v?(?.*)$`, 'gm').exec(context.payload.pull_request.head.ref).groups['v']; + const version = RegExp(`^${package}/v?(?.*)$`, 'gm').exec(context.payload.pull_request.head.ref).groups['v']; const runtime = require('.github/scripts/runtime.js')(scripts); const namespaces = ['docker.io/fangzhengjin', 'ghcr.io/containers-actions']; const tags = []; diff --git a/.github/scripts/runtime.js b/.github/scripts/runtime.js index eb297c8..1a54bf3 100644 --- a/.github/scripts/runtime.js +++ b/.github/scripts/runtime.js @@ -107,7 +107,7 @@ module.exports = (scripts) => { const newRef = await github.rest.git.createRef({ ...context.repo, ref: `refs/heads/${newBranch}`, - sha: originRef.data.object.sha, + sha: originRef.object.sha, }); return true; } @@ -224,7 +224,7 @@ module.exports = (scripts) => { }, uploadFileAndCreatePullRequest: async (package, latestVersion, uploadPath, content) => { const newLatestVersion = semver.clean(latestVersion, { loose: true }); - const newBranch = `${package}-${newLatestVersion}`; + const newBranch = `${package}/${newLatestVersion}`; await actions.autoPullRequest(newBranch, package, newLatestVersion, async () => { return await actions.updateFile( newBranch,