Skip to content

checkout v2 - #70

Merged
ericsciple merged 1 commit into
actions:masterfrom
ericsciple:users/ericsciple/action
Dec 3, 2019
Merged

ericsciple merged 1 commit into
actions:masterfrom
ericsciple:users/ericsciple/action

Conversation

@ericsciple

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread .github/workflows/test.yml Resolved
Comment thread .github/workflows/test.yml Resolved
Comment thread .github/workflows/test.yml Resolved
Comment thread lib/checkout.js Resolved
Comment thread src/checkout.ts Resolved
Comment thread src/checkout.ts Resolved
Comment thread src/fs-helper.ts Resolved
import * as io from '@actions/io';
import * as path from 'path';

export interface IGitCommandManager {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a wrapper over git.exe and exposes methods that correlate 1-to-1 with the git commands we need to run.

tryReset(): Promise<boolean>;
}

export async function CreateCommandManager(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to do some async stuff when initializing the GitCommandManager class, so this function is exposed and the ctor for GitCommandManager is private

Comment thread src/git-source-provider.ts Outdated

let authConfigKey = `http.https://github.com/.extraheader`;

export async function getSource(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the source provider. this basically drives the business logic

Comment thread src/post-checkout.ts Resolved
Comment thread lib/problem-matcher.json Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/fs-helper.ts Resolved
Comment thread src/fs-helper.ts Resolved
Comment thread src/git-command-manager.ts Resolved
Comment thread src/git-command-manager.ts Resolved
Comment thread src/checkout.ts Outdated
import * as path from 'path';

async function run() {
try {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment here about using error to break out of the method since there are methods below with side effects like error conditions that we expect to happen and stop continuation (and that is fully okay)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont understand what the concern is?

note, i renamed the file to main.ts so it should be more clear this is the outer try/catch

Comment thread src/git-command-manager.ts Resolved
Comment thread tsconfig.json Resolved
Comment thread .eslintrc.json
@@ -0,0 +1,58 @@
{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from actions/toolkit

Comment thread .prettierrc.json
@@ -0,0 +1,11 @@
{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from actions toolkit

Comment thread .github/workflows/test.yml Outdated
branches:
- master
- 'releases/*'
- users/ericsciple/action

@ericsciple ericsciple Nov 22, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line after done testing

Comment thread src/checkout.ts Outdated
path.join(__dirname, 'problem-matcher.json')
)

// Get sources

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add persist-credentials input

Comment thread src/fs-helper.ts
@@ -0,0 +1,77 @@
import * as fs from 'fs'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some useful helpers i think we should add to the toolkit.... separate pr

Comment thread README.md
Basic:
# Usage

<!-- start usage -->

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added a script to regenerate this from the action.yml

the CI verifies the docs are up to date

Comment thread src/misc/generate-docs.ts
//
// This script rebuilds the usage section in the README.md to be consistent with the action.yml

function updateUsage(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may want to move this function into a toolkit module

i added this based on feedback that the README.md should contain the inputs.

I didnt want to have to deal with maintaining both places, so now the CI runs the npm run gendocs and fails if it isnt up to date

Comment thread src/git-version.ts
}
}

checkMinimum(minimum: GitVersion): boolean {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add access modifiers to these methods to make them clear

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 however the prettier config didnt like it.

Comment thread src/git-version.ts Resolved
Comment thread src/git-source-provider.ts Outdated
lfs: boolean,
accessToken: string
): Promise<void> {
core.info(`Syncing repository: ${repositoryOwner}/${repositoryName}`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're missing a lot of line ending semicolons. not sure if this is intentional or not

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the prettier config. personally i think its weird but i just copied the config from the toolkit 🤷‍♂

Comment thread src/main.ts Resolved
Comment thread src/input-helper.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-source-provider.ts Resolved
Comment thread src/git-command-manager.ts Resolved
Comment thread src/git-command-manager.ts Resolved
@TingluoHuang

Copy link
Copy Markdown
Member

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants