feat: add variable commit_date#471
feat: add variable commit_date#471crazy-max merged 1 commit intodocker:masterfrom trim21:commit-date
commit_date#471Conversation
|
#470 has been merged, can you rebase please? |
|
I find a problem, we add |
There was a problem hiding this comment.
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
|
it will use local event data file for push event, and fallback to github api for PR. |
This comment was marked as outdated.
This comment was marked as outdated.
|
I may need to update GitHub mocking logic for better code style |
|
done |
|
review applied |
|
forget to run eslint 😅 |
|
Can you add to: Line 17 in 32323e5 |
|
done |
| 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.
I don't think this would work for pull requests from a fork
There was a problem hiding this comment.
There was a problem hiding this comment.
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.
no, a commit in a fork will also always exists in any forks. we do not need to handle this
There was a problem hiding this comment.
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.
in anyway, if sha is correct, we will get a commit. even if we send request to head repo not base repo
crazy-max
left a comment
There was a problem hiding this comment.
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
- pr:
metadata-action/__tests__/meta.test.ts
Line 2268 in 44d81d6
- pr-head-sha:
metadata-action/__tests__/meta.test.ts
Line 2627 in 44d81d6
- schedule:
metadata-action/__tests__/meta.test.ts
Line 2994 in 44d81d6
- release:
metadata-action/__tests__/meta.test.ts
Line 3250 in 44d81d6
Signed-off-by: Trim21 <[email protected]>
|
done |
|
is there a release cycle? |
Yes probably this week |
|
I forget to add this to toc |
##### [\`v6\`](docker/metadata-action@v5...v6) --- ##### [\`v6.0.0\`](https://github.com/docker/metadata-action/releases/tag/v6.0.0) - Node 24 as default runtime (requires [Actions Runner v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) or later) by [@crazy-max](https://github.com/crazy-max) in [#605](docker/metadata-action#605) - List inputs now preserve `#` inside values while still supporting full-line `#` comments by [@crazy-max](https://github.com/crazy-max) in [#607](docker/metadata-action#607) - Switch to ESM and update config/test wiring by [@crazy-max](https://github.com/crazy-max) in [#602](docker/metadata-action#602) - Bump lodash from 4.17.21 to 4.17.23 in [#588](docker/metadata-action#588) - Bump [@actions/core](https://github.com/actions/core) from 1.11.1 to 3.0.0 in [#599](docker/metadata-action#599) - Bump [@actions/github](https://github.com/actions/github) from 6.0.1 to 9.0.0 in [#597](docker/metadata-action#597) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.68.0 to 0.79.0 in [#604](docker/metadata-action#604) - Bump [@isaacs/brace-expansion](https://github.com/isaacs/brace-expansion) from 5.0.0 to 5.0.1 in [#600](docker/metadata-action#600) - Bump semver from 7.7.3 to 7.7.4 in [#603](docker/metadata-action#603) **Full Changelog**: <docker/metadata-action@v5.10.0...v6.0.0> --- ##### [\`v5.10.0\`](https://github.com/docker/metadata-action/releases/tag/v5.10.0) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.66.0 to 0.68.0 in [#559](docker/metadata-action#559) [#569](docker/metadata-action#569) - Bump js-yaml from 3.14.1 to 3.14.2 in [#564](docker/metadata-action#564) **Full Changelog**: <docker/metadata-action@v5.9.0...v5.10.0> --- ##### [\`v5.9.0\`](https://github.com/docker/metadata-action/releases/tag/v5.9.0) - Add `tag-names` output to return tag names without image base name by [@crazy-max](https://github.com/crazy-max) in [#553](docker/metadata-action#553) - Bump [@babel/runtime-corejs3](https://github.com/babel/runtime-corejs3) from 7.14.7 to 7.28.2 in [#539](docker/metadata-action#539) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.62.1 to 0.66.0 in [#555](docker/metadata-action#555) - Bump brace-expansion from 1.1.11 to 1.1.12 in [#540](docker/metadata-action#540) - Bump csv-parse from 5.6.0 to 6.1.0 in [#532](docker/metadata-action#532) - Bump semver from 7.7.2 to 7.7.3 in in [#554](docker/metadata-action#554) - Bump tmp from 0.2.3 to 0.2.5 in [#541](docker/metadata-action#541) **Full Changelog**: <docker/metadata-action@v5.8.0...v5.9.0> --- ##### [\`v5.8.0\`](https://github.com/docker/metadata-action/releases/tag/v5.8.0) - New `is_not_default_branch` global expression by [@crazy-max](https://github.com/crazy-max) in [#535](docker/metadata-action#535) - Allow to match part of the git tag or value for semver/pep440 types by [@crazy-max](https://github.com/crazy-max) in [#536](docker/metadata-action#536) [#537](docker/metadata-action#537) - Bump [@actions/github](https://github.com/actions/github) from 6.0.0 to 6.0.1 in [#523](docker/metadata-action#523) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.56.0 to 0.62.1 in [#526](docker/metadata-action#526) - Bump form-data from 2.5.1 to 2.5.5 in [#533](docker/metadata-action#533) - Bump moment-timezone from 0.5.47 to 0.6.0 in [#525](docker/metadata-action#525) - Bump semver from 7.7.1 to 7.7.2 in [#524](docker/metadata-action#524) **Full Changelog**: <docker/metadata-action@v5.7.0...v5.8.0> --- ##### [\`v5.7.0\`](https://github.com/docker/metadata-action/releases/tag/v5.7.0) - Global expressions support for labels and annotations by [@crazy-max](https://github.com/crazy-max) in [#489](docker/metadata-action#489) - Support disabling outputs as environment variables by [@omus](https://github.com/omus) in [#497](docker/metadata-action#497) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.44.0 to 0.56.0 in [#507](docker/metadata-action#507) [#509](docker/metadata-action#509) - Bump csv-parse from 5.5.6 to 5.6.0 in [#482](docker/metadata-action#482) - Bump moment-timezone from 0.5.46 to 0.5.47 in [#501](docker/metadata-action#501) - Bump semver from 7.6.3 to 7.7.1 in [#504](docker/metadata-action#504) **Full Changelog**: <docker/metadata-action@v5.6.1...v5.7.0> --- ##### [\`v5.6.1\`](https://github.com/docker/metadata-action/releases/tag/v5.6.1) - Fix GitHub API request fallback for commit date by [@crazy-max](https://github.com/crazy-max) in [#478](docker/metadata-action#478) - Revert to default commit SHA length of 7 by [@crazy-max](https://github.com/crazy-max) in [#480](docker/metadata-action#480) **Full Changelog**: <docker/metadata-action@v5.6.0...v5.6.1> --- ##### [\`v5.6.0\`](https://github.com/docker/metadata-action/releases/tag/v5.6.0) - Add `commit_date` global expression by [@trim21](https://github.com/trim21) in [#471](docker/metadata-action#471) [#475](docker/metadata-action#475) - Increase short commit sha length to 12 for uniqueness by [@crazy-max](https://github.com/crazy-max) in [#467](docker/metadata-action#467) - Bump [@actions/core](https://github.com/actions/core) from 1.10.1 to 1.11.1 [#460](docker/metadata-action#460) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.16.1 to 0.44.0 [#391](docker/metadata-action#391) [#399](docker/metadata-action#399) [#413](docker/metadata-action#413) [#441](docker/metadata-action#441) - Bump braces from 3.0.2 to 3.0.3 [#424](docker/metadata-action#424) - Bump cross-spawn from 7.0.3 to 7.0.5 [#474](docker/metadata-action#474) - Bump csv-parse from 5.5.5 to 5.5.6 [#412](docker/metadata-action#412) - Bump moment-timezone from 0.5.44 to 0.5.46 [#383](docker/metadata-action#383) [#470](docker/metadata-action#470) [#459](docker/metadata-action#459) - Bump path-to-regexp from 6.2.2 to 6.3.0 [#454](docker/metadata-action#454) - Bump semver from 7.6.0 to 7.6.3 [#400](docker/metadata-action#400) [#411](docker/metadata-action#411) [#440](docker/metadata-action#440) - Bump undici from 5.26.3 to 5.28.4 [#386](docker/metadata-action#386) [#402](docker/metadata-action#402) **Full Changelog**: <docker/metadata-action@v5.5.1...v5.6.0> --- ##### [\`v5.5.1\`](https://github.com/docker/metadata-action/releases/tag/v5.5.1) - Don't set `cwd://` prefix for local bake files by [@crazy-max](https://github.com/crazy-max) in [#382](docker/metadata-action#382) **Full Changelog**: <docker/metadata-action@v5.5.0...v5.5.1> --- ##### [\`v5.5.0\`](https://github.com/docker/metadata-action/releases/tag/v5.5.0) - Set `cwd://` prefix for bake files path by [@crazy-max](https://github.com/crazy-max) in [#370](docker/metadata-action#370) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.16.0 to 0.16.1 in [#371](docker/metadata-action#371) - Bump moment from 2.29.4 to 2.30.1 in [#373](docker/metadata-action#373) - Bump moment-timezone from 0.5.43 to 0.5.44 in [#374](docker/metadata-action#374) **Full Changelog**: <docker/metadata-action@v5.4.0...v5.5.0> --- ##### [\`v5.4.0\`](https://github.com/docker/metadata-action/releases/tag/v5.4.0) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.15.0 to 0.16.0 in [#369](docker/metadata-action#369) - Bump csv-parse from 5.5.2 to 5.5.3 in [#365](docker/metadata-action#365) **Full Changelog**: <docker/metadata-action@v5.3.0...v5.4.0> --- ##### [\`v5.3.0\`](https://github.com/docker/metadata-action/releases/tag/v5.3.0) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.14.0 to 0.15.0 in [#363](docker/metadata-action#363) (fixes [#362](docker/metadata-action#362)) **Full Changelog**: <docker/metadata-action@v5.2.0...v5.3.0> --- ##### [\`v5.2.0\`](https://github.com/docker/metadata-action/releases/tag/v5.2.0) - Custom annotations support by [@crazy-max](https://github.com/crazy-max) in [#361](docker/metadata-action#361) **Full Changelog**: <docker/metadata-action@v5.1.0...v5.2.0> --- ##### [\`v5.1.0\`](https://github.com/docker/metadata-action/releases/tag/v5.1.0) - Annotations support by [@crazy-max](https://github.com/crazy-max) in [#352](docker/metadata-action#352) - Split bake definition into two files by [@crazy-max](https://github.com/crazy-max) in [#353](docker/metadata-action#353) - Allow images input to be empty to output bare tags by [@crazy-max](https://github.com/crazy-max) in [#358](docker/metadata-action#358) - Bump [@actions/github](https://github.com/actions/github) from 5.1.1 to 6.0.0 in [#348](docker/metadata-action#348) - Bump [@babel/traverse](https://github.com/babel/traverse) from 7.17.3 to 7.23.2 in [#350](docker/metadata-action#350) - Bump [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.12.0 to 0.14.0 in [#349](docker/metadata-action#349) [#357](docker/metadata-action#357) - Bump csv-parse from 5.5.0 to 5.5.2 in [#346](docker/metadata-action#346) - Bump semver from 7.5.3 to 7.5.4 in [#335](docker/metadata-action#335) **Full Changelog**: <docker/metadata-action@v5.0.0...v5.1.0>
No description provided.