@postman-cse/onboarding-repo-sync 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action.cjs +14 -14
- package/dist/cli.cjs +14 -14
- package/dist/index.cjs +14 -14
- package/package.json +4 -3
package/dist/action.cjs
CHANGED
|
@@ -118857,9 +118857,9 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118857
118857
|
headBranch = headRef;
|
|
118858
118858
|
rawRef = clean(env.GITHUB_REF) ?? headRef;
|
|
118859
118859
|
refKind = "branch";
|
|
118860
|
-
const headRepo = event?.pull_request?.head?.repo?.full_name;
|
|
118861
|
-
const baseRepo = event?.pull_request?.base?.repo?.full_name
|
|
118862
|
-
isForkPr =
|
|
118860
|
+
const headRepo = clean(event?.pull_request?.head?.repo?.full_name)?.toLowerCase();
|
|
118861
|
+
const baseRepo = clean(event?.pull_request?.base?.repo?.full_name)?.toLowerCase();
|
|
118862
|
+
isForkPr = !(headRepo && baseRepo && headRepo === baseRepo);
|
|
118863
118863
|
headSha = clean(event?.pull_request?.head?.sha) ?? headSha;
|
|
118864
118864
|
} else {
|
|
118865
118865
|
rawRef = clean(env.GITHUB_REF) ?? clean(env.GITHUB_REF_NAME);
|
|
@@ -118880,7 +118880,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118880
118880
|
refKind = "branch";
|
|
118881
118881
|
const sourceProject = clean(env.CI_MERGE_REQUEST_SOURCE_PROJECT_ID);
|
|
118882
118882
|
const targetProject = clean(env.CI_MERGE_REQUEST_PROJECT_ID);
|
|
118883
|
-
isForkPr =
|
|
118883
|
+
isForkPr = !(sourceProject && targetProject && sourceProject === targetProject);
|
|
118884
118884
|
} else if (clean(env.CI_COMMIT_TAG)) {
|
|
118885
118885
|
rawRef = clean(env.CI_COMMIT_TAG);
|
|
118886
118886
|
refKind = "tag";
|
|
@@ -118914,7 +118914,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118914
118914
|
rawRef = prSource;
|
|
118915
118915
|
refKind = parsed.kind;
|
|
118916
118916
|
const forkFlag = clean(env.SYSTEM_PULLREQUEST_ISFORK);
|
|
118917
|
-
isForkPr = forkFlag?.toLowerCase()
|
|
118917
|
+
isForkPr = forkFlag?.toLowerCase() !== "false";
|
|
118918
118918
|
} else {
|
|
118919
118919
|
rawRef = clean(env.BUILD_SOURCEBRANCH);
|
|
118920
118920
|
const parsed = stripRefPrefix(rawRef);
|
|
@@ -118999,6 +118999,15 @@ function resolveBranchDecision(options) {
|
|
|
118999
118999
|
reason: `ref kind ${identity.refKind}: never canonical/preview-eligible; no-op with annotation`
|
|
119000
119000
|
};
|
|
119001
119001
|
}
|
|
119002
|
+
if (identity.isForkPr) {
|
|
119003
|
+
return {
|
|
119004
|
+
tier: "gated",
|
|
119005
|
+
strategy,
|
|
119006
|
+
identity,
|
|
119007
|
+
canonicalBranch,
|
|
119008
|
+
reason: "fork PR: never write-eligible (canonical/channel/preview require a same-repo head), gated instead"
|
|
119009
|
+
};
|
|
119010
|
+
}
|
|
119002
119011
|
if (identity.headBranch === canonicalBranch) {
|
|
119003
119012
|
return {
|
|
119004
119013
|
tier: "canonical",
|
|
@@ -119020,15 +119029,6 @@ function resolveBranchDecision(options) {
|
|
|
119020
119029
|
};
|
|
119021
119030
|
}
|
|
119022
119031
|
if (strategy === "preview") {
|
|
119023
|
-
if (identity.isForkPr) {
|
|
119024
|
-
return {
|
|
119025
|
-
tier: "gated",
|
|
119026
|
-
strategy,
|
|
119027
|
-
identity,
|
|
119028
|
-
canonicalBranch,
|
|
119029
|
-
reason: "fork PR: preview-ineligible (same-repo gate), gated instead"
|
|
119030
|
-
};
|
|
119031
|
-
}
|
|
119032
119032
|
return {
|
|
119033
119033
|
tier: "preview",
|
|
119034
119034
|
strategy,
|
package/dist/cli.cjs
CHANGED
|
@@ -116910,9 +116910,9 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
116910
116910
|
headBranch = headRef;
|
|
116911
116911
|
rawRef = clean(env.GITHUB_REF) ?? headRef;
|
|
116912
116912
|
refKind = "branch";
|
|
116913
|
-
const headRepo = event?.pull_request?.head?.repo?.full_name;
|
|
116914
|
-
const baseRepo = event?.pull_request?.base?.repo?.full_name
|
|
116915
|
-
isForkPr =
|
|
116913
|
+
const headRepo = clean(event?.pull_request?.head?.repo?.full_name)?.toLowerCase();
|
|
116914
|
+
const baseRepo = clean(event?.pull_request?.base?.repo?.full_name)?.toLowerCase();
|
|
116915
|
+
isForkPr = !(headRepo && baseRepo && headRepo === baseRepo);
|
|
116916
116916
|
headSha = clean(event?.pull_request?.head?.sha) ?? headSha;
|
|
116917
116917
|
} else {
|
|
116918
116918
|
rawRef = clean(env.GITHUB_REF) ?? clean(env.GITHUB_REF_NAME);
|
|
@@ -116933,7 +116933,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
116933
116933
|
refKind = "branch";
|
|
116934
116934
|
const sourceProject = clean(env.CI_MERGE_REQUEST_SOURCE_PROJECT_ID);
|
|
116935
116935
|
const targetProject = clean(env.CI_MERGE_REQUEST_PROJECT_ID);
|
|
116936
|
-
isForkPr =
|
|
116936
|
+
isForkPr = !(sourceProject && targetProject && sourceProject === targetProject);
|
|
116937
116937
|
} else if (clean(env.CI_COMMIT_TAG)) {
|
|
116938
116938
|
rawRef = clean(env.CI_COMMIT_TAG);
|
|
116939
116939
|
refKind = "tag";
|
|
@@ -116967,7 +116967,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
116967
116967
|
rawRef = prSource;
|
|
116968
116968
|
refKind = parsed.kind;
|
|
116969
116969
|
const forkFlag = clean(env.SYSTEM_PULLREQUEST_ISFORK);
|
|
116970
|
-
isForkPr = forkFlag?.toLowerCase()
|
|
116970
|
+
isForkPr = forkFlag?.toLowerCase() !== "false";
|
|
116971
116971
|
} else {
|
|
116972
116972
|
rawRef = clean(env.BUILD_SOURCEBRANCH);
|
|
116973
116973
|
const parsed = stripRefPrefix(rawRef);
|
|
@@ -117052,6 +117052,15 @@ function resolveBranchDecision(options) {
|
|
|
117052
117052
|
reason: `ref kind ${identity.refKind}: never canonical/preview-eligible; no-op with annotation`
|
|
117053
117053
|
};
|
|
117054
117054
|
}
|
|
117055
|
+
if (identity.isForkPr) {
|
|
117056
|
+
return {
|
|
117057
|
+
tier: "gated",
|
|
117058
|
+
strategy,
|
|
117059
|
+
identity,
|
|
117060
|
+
canonicalBranch,
|
|
117061
|
+
reason: "fork PR: never write-eligible (canonical/channel/preview require a same-repo head), gated instead"
|
|
117062
|
+
};
|
|
117063
|
+
}
|
|
117055
117064
|
if (identity.headBranch === canonicalBranch) {
|
|
117056
117065
|
return {
|
|
117057
117066
|
tier: "canonical",
|
|
@@ -117073,15 +117082,6 @@ function resolveBranchDecision(options) {
|
|
|
117073
117082
|
};
|
|
117074
117083
|
}
|
|
117075
117084
|
if (strategy === "preview") {
|
|
117076
|
-
if (identity.isForkPr) {
|
|
117077
|
-
return {
|
|
117078
|
-
tier: "gated",
|
|
117079
|
-
strategy,
|
|
117080
|
-
identity,
|
|
117081
|
-
canonicalBranch,
|
|
117082
|
-
reason: "fork PR: preview-ineligible (same-repo gate), gated instead"
|
|
117083
|
-
};
|
|
117084
|
-
}
|
|
117085
117085
|
return {
|
|
117086
117086
|
tier: "preview",
|
|
117087
117087
|
strategy,
|
package/dist/index.cjs
CHANGED
|
@@ -118881,9 +118881,9 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118881
118881
|
headBranch = headRef;
|
|
118882
118882
|
rawRef = clean(env.GITHUB_REF) ?? headRef;
|
|
118883
118883
|
refKind = "branch";
|
|
118884
|
-
const headRepo = event?.pull_request?.head?.repo?.full_name;
|
|
118885
|
-
const baseRepo = event?.pull_request?.base?.repo?.full_name
|
|
118886
|
-
isForkPr =
|
|
118884
|
+
const headRepo = clean(event?.pull_request?.head?.repo?.full_name)?.toLowerCase();
|
|
118885
|
+
const baseRepo = clean(event?.pull_request?.base?.repo?.full_name)?.toLowerCase();
|
|
118886
|
+
isForkPr = !(headRepo && baseRepo && headRepo === baseRepo);
|
|
118887
118887
|
headSha = clean(event?.pull_request?.head?.sha) ?? headSha;
|
|
118888
118888
|
} else {
|
|
118889
118889
|
rawRef = clean(env.GITHUB_REF) ?? clean(env.GITHUB_REF_NAME);
|
|
@@ -118904,7 +118904,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118904
118904
|
refKind = "branch";
|
|
118905
118905
|
const sourceProject = clean(env.CI_MERGE_REQUEST_SOURCE_PROJECT_ID);
|
|
118906
118906
|
const targetProject = clean(env.CI_MERGE_REQUEST_PROJECT_ID);
|
|
118907
|
-
isForkPr =
|
|
118907
|
+
isForkPr = !(sourceProject && targetProject && sourceProject === targetProject);
|
|
118908
118908
|
} else if (clean(env.CI_COMMIT_TAG)) {
|
|
118909
118909
|
rawRef = clean(env.CI_COMMIT_TAG);
|
|
118910
118910
|
refKind = "tag";
|
|
@@ -118938,7 +118938,7 @@ function resolveBranchIdentity(env = process.env, overrides = {}) {
|
|
|
118938
118938
|
rawRef = prSource;
|
|
118939
118939
|
refKind = parsed.kind;
|
|
118940
118940
|
const forkFlag = clean(env.SYSTEM_PULLREQUEST_ISFORK);
|
|
118941
|
-
isForkPr = forkFlag?.toLowerCase()
|
|
118941
|
+
isForkPr = forkFlag?.toLowerCase() !== "false";
|
|
118942
118942
|
} else {
|
|
118943
118943
|
rawRef = clean(env.BUILD_SOURCEBRANCH);
|
|
118944
118944
|
const parsed = stripRefPrefix(rawRef);
|
|
@@ -119023,6 +119023,15 @@ function resolveBranchDecision(options) {
|
|
|
119023
119023
|
reason: `ref kind ${identity.refKind}: never canonical/preview-eligible; no-op with annotation`
|
|
119024
119024
|
};
|
|
119025
119025
|
}
|
|
119026
|
+
if (identity.isForkPr) {
|
|
119027
|
+
return {
|
|
119028
|
+
tier: "gated",
|
|
119029
|
+
strategy,
|
|
119030
|
+
identity,
|
|
119031
|
+
canonicalBranch,
|
|
119032
|
+
reason: "fork PR: never write-eligible (canonical/channel/preview require a same-repo head), gated instead"
|
|
119033
|
+
};
|
|
119034
|
+
}
|
|
119026
119035
|
if (identity.headBranch === canonicalBranch) {
|
|
119027
119036
|
return {
|
|
119028
119037
|
tier: "canonical",
|
|
@@ -119044,15 +119053,6 @@ function resolveBranchDecision(options) {
|
|
|
119044
119053
|
};
|
|
119045
119054
|
}
|
|
119046
119055
|
if (strategy === "preview") {
|
|
119047
|
-
if (identity.isForkPr) {
|
|
119048
|
-
return {
|
|
119049
|
-
tier: "gated",
|
|
119050
|
-
strategy,
|
|
119051
|
-
identity,
|
|
119052
|
-
canonicalBranch,
|
|
119053
|
-
reason: "fork PR: preview-ineligible (same-repo gate), gated instead"
|
|
119054
|
-
};
|
|
119055
|
-
}
|
|
119056
119056
|
return {
|
|
119057
119057
|
tier: "preview",
|
|
119058
119058
|
strategy,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postman-cse/onboarding-repo-sync",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "Postman repo sync GitHub Action.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"lint:fix": "eslint . --fix",
|
|
28
28
|
"test": "vitest run --exclude tests/ci-workflow-template.test.ts && vitest run tests/ci-workflow-template.test.ts && node --test .github/scripts/dispatch-e2e-monitor.test.mjs",
|
|
29
|
-
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
29
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
30
|
+
"record:cassettes": "RECORD_FAKE_CASSETTES=1 vitest run tests/contract/record-fake-cassettes.test.ts"
|
|
30
31
|
},
|
|
31
32
|
"keywords": [
|
|
32
33
|
"github-action",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@actions/core": "^3.0.1",
|
|
47
48
|
"@actions/exec": "^3.0.0",
|
|
48
|
-
"@postman-cse/automation-core": "^1.
|
|
49
|
+
"@postman-cse/automation-core": "^1.6.0",
|
|
49
50
|
"@postman/runtime.models": "^1.13.1",
|
|
50
51
|
"@postman/v3.export": "0.2.28",
|
|
51
52
|
"js-yaml": "^5.2.1",
|