mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(ci): bound Mantis Discord fetches (#110851)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -85,14 +85,14 @@ jobs:
|
||||
selected_revision="$(git rev-parse HEAD)"
|
||||
trusted_reason=""
|
||||
|
||||
git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
|
||||
timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
|
||||
|
||||
if git merge-base --is-ancestor "$selected_revision" refs/remotes/origin/main; then
|
||||
trusted_reason="main-ancestor"
|
||||
elif git tag --points-at "$selected_revision" | grep -Eq '^v'; then
|
||||
trusted_reason="release-tag"
|
||||
elif [[ "$INPUT_REF" =~ ^release/[0-9]{4}\.[0-9]+\.[0-9]+$ ]]; then
|
||||
git fetch --no-tags origin "+refs/heads/${INPUT_REF}:refs/remotes/origin/${INPUT_REF}"
|
||||
timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin "+refs/heads/${INPUT_REF}:refs/remotes/origin/${INPUT_REF}"
|
||||
release_branch_sha="$(git rev-parse "refs/remotes/origin/${INPUT_REF}")"
|
||||
if [[ "$selected_revision" == "$release_branch_sha" ]]; then
|
||||
trusted_reason="release-branch-head"
|
||||
|
||||
@@ -3240,6 +3240,20 @@ describe("ci workflow guards", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("bounds mantis discord smoke validation git fetches", () => {
|
||||
const workflowPath = ".github/workflows/mantis-discord-smoke.yml";
|
||||
const source = readFileSync(workflowPath, "utf8");
|
||||
const gitFetchLines = source.split("\n").filter((line) => line.includes("git fetch"));
|
||||
|
||||
expect(gitFetchLines, workflowPath).toHaveLength(2);
|
||||
expect(
|
||||
gitFetchLines.every((line) =>
|
||||
line.trimStart().startsWith("timeout --signal=TERM --kill-after=10s 120s git fetch"),
|
||||
),
|
||||
workflowPath,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("bounds release ref validation fetches across checkout auth modes", () => {
|
||||
const resolveTargetSteps = readReleaseChecksWorkflow().jobs.resolve_target.steps;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user