GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add method to get commit date from git by trim21 · Pull Request #489 · docker/actions-toolkit

Conversation

@trim21

@trim21 trim21 commented Nov 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

for docker/metadata-action#308

sorry to create this PR again, I did some force push and it cause github not working as expected.

and looks like ci failed with other tests, not caused be this PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
crazy-max
crazy-max requested changes Nov 13, 2024
View reviewed changes
Comment thread src/git.ts Outdated
Comment on lines +167 to +169
public static async commitDate(ref: string, gitDir: string | undefined = undefined): Promise<Date> {
const args = ['show', '-s', '--format="%ci"', ref];
if (gitDir !== undefined) {
args.push('--');
args.push(gitDir);
}

return new Date(await Git.exec(args));
}

@crazy-max crazy-max Nov 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Don't think we need a gitDir opt like other methods we have:

  public static async commitDate(ref: string): Promise<Date> {
    return new Date(await Git.exec(['show', '-s', '--format="%ci"', ref]));
  }

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@trim21 trim21 Nov 13, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@trim21
feat: add method to get commit date from git
31cb9c3
Signed-off-by: Trim21 <[email protected]>
@trim21
trim21 force-pushed the get-commit-data branch from ca3f52f to 31cb9c3 Compare November 13, 2024 12:11
crazy-max
crazy-max approved these changes Nov 13, 2024
View reviewed changes

@crazy-max crazy-max left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max
crazy-max merged commit 8672cc7 into docker:main Nov 13, 2024
@trim21
trim21 deleted the get-commit-data branch November 13, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crazy-max crazy-max crazy-max approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@trim21 @crazy-max
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.