Skip to content

Commit 5b74cb2

Browse files
committed
WIP
1 parent 6382072 commit 5b74cb2

File tree

4 files changed

+3423
-3195
lines changed

4 files changed

+3423
-3195
lines changed

.github/local-actions/branch-manager/lib/git.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ import {
1717
const mainBranchName = 'main';
1818

1919
export async function setupConfigAndGitClient(token: string, repo: {owner: string; repo: string}) {
20-
// Manually define the configuration for the pull request and github to prevent having to
21-
// checkout the repository before defining the config.
22-
// TODO(josephperrott): Load this from the actual repository.
23-
setConfig(<{pullRequest: PullRequestConfig; github: GithubConfig; caretaker: CaretakerConfig}>{
24-
github: {
25-
mainBranchName,
26-
owner: repo.owner,
27-
name: repo.repo,
28-
},
29-
pullRequest: {
30-
githubApiMerge: false,
31-
},
32-
caretaker: {},
33-
});
20+
21+
22+
//// Manually define the configuration for the pull request and github to prevent having to
23+
//// checkout the repository before defining the config.
24+
//// TODO(josephperrott): Load this from the actual repository.
25+
//setConfig(<{pullRequest: PullRequestConfig; github: GithubConfig; caretaker: CaretakerConfig}>{
26+
// github: {
27+
// mainBranchName,
28+
// owner: repo.owner,
29+
// name: repo.repo,
30+
// },
31+
// pullRequest: {
32+
// githubApiMerge: false,
33+
// },
34+
// caretaker: {},
35+
//});
3436
/** The configuration used for the ng-dev tooling. */
3537
const config = await getConfig([
3638
assertValidGithubConfig,

.github/local-actions/branch-manager/lib/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
import {MergeConflictsFatalError} from '../../../../ng-dev/pr/merge/failures.js';
1313
import {createPullRequestValidationConfig} from '../../../../ng-dev/pr/common/validation/validation-config.js';
1414
import {InvalidTargetLabelError} from '../../../../ng-dev/pr/common/targeting/target-label.js';
15-
import {resolve} from 'path';
1615

1716
interface CommmitStatus {
1817
state: 'pending' | 'error' | 'failure' | 'success';
@@ -28,6 +27,11 @@ const repo = core.getInput('repo', {required: true, trimWhitespace: true});
2827
const owner = core.getInput('owner', {required: true, trimWhitespace: true});
2928
/** The pull request number. */
3029
const pr = Number(core.getInput('pr', {required: true, trimWhitespace: true}));
30+
31+
// Create a tmp directory to perform checks in and change working to directory to it.
32+
await cloneRepoIntoTmpLocation({owner, repo});
33+
34+
3135
// If the provided pr is not a number, we cannot evaluate the mergeability.
3236
if (isNaN(pr)) {
3337
core.setFailed('The provided pr value was not a number');
@@ -86,9 +90,6 @@ async function main() {
8690
false,
8791
);
8892

89-
// Create a tmp directory to perform checks in and change working to directory to it.
90-
await cloneRepoIntoTmpLocation({owner, repo});
91-
9293
/** The pull request after being retrieved and validated. */
9394
const pullRequest = await loadAndValidatePullRequest(
9495
{git, config},

0 commit comments

Comments
 (0)