-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add variable commit_date
#471
Conversation
#470 has been merged, can you rebase please? |
I find a problem, we add |
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.
Missing js artifacts build with docker buildx bake pre-checkin
, see: https://github.com/docker/metadata-action/blob/master/.github/CONTRIBUTING.md#submitting-a-pull-request
Missing DCO as well https://github.com/docker/metadata-action/pull/471/checks?check_run_id=32924130175
25df83a
to
02b92e6
Compare
it will use local event data file for push event, and fallback to github api for PR. |
1434e0e
to
b63fcf7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
I may need to update GitHub mocking logic for better code style |
9968536
to
1c7e57e
Compare
done |
12a07fa
to
2ee1f2a
Compare
review applied |
forget to run eslint 😅 |
Can you add
to: Line 17 in 32323e5
|
done |
40465f6
to
69486da
Compare
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.
I just merged #472 to check the behavior for git context, can you rebase?
const commit = await toolkit.github.octokit.request('GET /repos/{owner}/{repo}/commits/{commit_sha}', { | ||
commit_sha: sha, | ||
owner: GitHub.context.repo.owner, | ||
repo: GitHub.context.repo.repo | ||
}); |
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.
I don't think this would work for pull requests from a fork
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.
see this: trim21#2
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.
Looking at https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit--parameters I think we can just pass the full ref like:
const commit = await toolkit.github.octokit.request('GET /repos/{owner}/{repo}/commits/{commit_sha}', { | |
commit_sha: sha, | |
owner: GitHub.context.repo.owner, | |
repo: GitHub.context.repo.repo | |
}); | |
const commit = await toolkit.github.octokit.request('GET /repos/{owner}/{repo}/commits/{GitHub.context.ref}', { | |
owner: GitHub.context.repo.owner, | |
repo: GitHub.context.repo.repo | |
}); |
In case of a pull request it would be smth like 'GET /repos/{owner}/{repo}/commits/pull/471/merge'
for your pr.
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.
no, a commit in a fork will also always exists in any forks. we do not need to handle this
for example: trim21@4a4aa3e
https://api.github.com/repos/trim21/metadata-action/commits/4a4aa3e4cba597bb90d7342e9a2da7891cb822eb
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.
see this: trim21#2
I meant for a pull request from a fork but seems GitHub handles that: https://github.com/docker/metadata-action/actions/runs/11832905758/job/32970605385?pr=471#step:3:18
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.
in anyway, if sha is correct, we will get a commit. even if we send request to head repo not base repo
27580b6
to
ce0e6b3
Compare
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.
Overall LGTM thanks!
Can we have more test cases in meta.test.ts
to cover other kind of events:
- push:
metadata-action/__tests__/meta.test.ts
Line 130 in 44d81d6
describe('push', () => { - pr:
metadata-action/__tests__/meta.test.ts
Line 2268 in 44d81d6
describe('pr', () => { - pr-head-sha:
metadata-action/__tests__/meta.test.ts
Line 2627 in 44d81d6
describe('pr-head-sha', () => { - schedule:
metadata-action/__tests__/meta.test.ts
Line 2994 in 44d81d6
describe('schedule', () => { - release:
metadata-action/__tests__/meta.test.ts
Line 3250 in 44d81d6
describe('release', () => {
750c474
to
b74a4a7
Compare
Signed-off-by: Trim21 <[email protected]>
done |
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!
is there a release cycle? |
Yes probably this week |
I forget to add this to toc |
No description provided.