Skip to content
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: allows to specify context to fetch git data #248

Merged
merged 1 commit into from
Mar 30, 2023
Merged

feat: allows to specify context to fetch git data #248

merged 1 commit into from
Mar 30, 2023

Conversation

neilime
Copy link

@neilime neilime commented Dec 15, 2022

Fix #139

Add context input to specify where to get context data. Allowed options are: "workflow" (default), "git".

workflow context

context: workflow
sha: context.sha
ref: context.ref

git context

Will get Git context from previously checkout repository. @see https://github.com/actions/checkout

context: git
sha: git rev rev-parse HEAD
ref: git symbolic-ref HEAD

@neilime neilime marked this pull request as draft December 15, 2022 13:47
@neilime neilime marked this pull request as ready for review December 18, 2022 05:09
@fredleger
Copy link

We also ran into an issue that can be fixed by this PR. From my point of view it makes totally sense

@crazy-max
Copy link
Member

Thanks for your contrib, I think you can squash your commits and also fix DCO, see https://github.com/docker/metadata-action/pull/248/checks?check_run_id=10165522880

@neilime
Copy link
Author

neilime commented Dec 19, 2022

Thanks for your contrib, I think you can squash your commits and also fix DCO, see https://github.com/docker/metadata-action/pull/248/checks?check_run_id=10165522880

Done @crazy-max

src/context.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@neilime
Copy link
Author

neilime commented Jan 16, 2023

@crazy-max, need your approval to run workflow and your review.

Thanks

@qwqcode
Copy link

qwqcode commented Jan 25, 2023

This PR solves the problem I'm having perfectly, I'd really appreciate it if could be merged soon. 😁

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

Thanks for updating with latest actions-toolkit release. See my comments.

See also ci failure: https://github.com/docker/metadata-action/actions/runs/4323012276/jobs/7547788506#step:4:5637

package.json Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@neilime
Copy link
Author

neilime commented Mar 30, 2023

@crazy-max, feedbacks are resolved and tests fixed, can you have a look please.

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

Some nits and should be good after that

__tests__/meta.test.ts Show resolved Hide resolved
src/context.ts Outdated Show resolved Hide resolved
src/context.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@crazy-max crazy-max merged commit 1ce9422 into docker:master Mar 30, 2023
pascalberger referenced this pull request in swissgrc/.github Apr 18, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [docker/metadata-action](https://togithub.com/docker/metadata-action)
| action | minor | `v4.3.0` -> `v4.4.0` |

---

### Release Notes

<details>
<summary>docker/metadata-action</summary>

###
[`v4.4.0`](https://togithub.com/docker/metadata-action/releases/tag/v4.4.0)

[Compare
Source](https://togithub.com/docker/metadata-action/compare/v4.3.0...v4.4.0)

- Add `context` input to define the metadata provider by
[@&#8203;neilime](https://togithub.com/neilime) in
[https://github.com/docker/metadata-action/pull/248](https://togithub.com/docker/metadata-action/pull/248)
- Switch to actions-toolkit implementation by
[@&#8203;crazy-max](https://togithub.com/crazy-max) in
[https://github.com/docker/metadata-action/pull/266](https://togithub.com/docker/metadata-action/pull/266)
[https://github.com/docker/metadata-action/pull/273](https://togithub.com/docker/metadata-action/pull/273)
[https://github.com/docker/metadata-action/pull/284](https://togithub.com/docker/metadata-action/pull/284)
- Bump csv-parse from 5.3.3 to 5.3.8 in
[https://github.com/docker/metadata-action/pull/271](https://togithub.com/docker/metadata-action/pull/271)
[https://github.com/docker/metadata-action/pull/286](https://togithub.com/docker/metadata-action/pull/286)
- Bump moment-timezone from 0.5.40 to 0.5.43 in
[https://github.com/docker/metadata-action/pull/268](https://togithub.com/docker/metadata-action/pull/268)
[https://github.com/docker/metadata-action/pull/278](https://togithub.com/docker/metadata-action/pull/278)
[https://github.com/docker/metadata-action/pull/281](https://togithub.com/docker/metadata-action/pull/281)
- Bump semver from 7.4.0 to 7.5.0 in
[https://github.com/docker/metadata-action/pull/285](https://togithub.com/docker/metadata-action/pull/285)

**Full Changelog**:
docker/metadata-action@v4.3.0...v4.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/swissgrc/.github).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40OS4wIiwidXBkYXRlZEluVmVyIjoiMzUuNDkuMCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
julio-lopez added a commit to kanisterio/kanister that referenced this pull request Sep 14, 2023
Upgrades the action to 96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0

Release notes:

Release notes
Sourced from docker/metadata-action's releases.

v5.0.0
Node 20 as default runtime (requires Actions Runner v2.308.0 or later) by @​crazy-max in docker/metadata-action#328
Bump @​actions/core from 1.10.0 to 1.10.1 in docker/metadata-action#333
Bump csv-parse from 5.4.0 to 5.5.0 in docker/metadata-action#320
Bump semver from 7.5.1 to 7.5.2 in docker/metadata-action#304
Bump handlebars from 4.7.7 to 4.7.8 in docker/metadata-action#315
Full Changelog: docker/[email protected]

v4.6.0
Dedup and sort labels by @​crazy-max in docker/metadata-action#301
Bump @​docker/actions-toolkit from 0.3.0 to 0.5.0 in docker/metadata-action#302
Full Changelog: docker/[email protected]

v4.5.0
Bump @​docker/actions-toolkit from 0.1.0 to 0.3.0 in docker/metadata-action#296
Bump csv-parse from 5.3.8 to 5.4.0 in docker/metadata-action#294
Full Changelog: docker/[email protected]

v4.4.0
Add context input to define the metadata provider by @​neilime in docker/metadata-action#248
Switch to actions-toolkit implementation by @​crazy-max in docker/metadata-action#266 docker/metadata-action#273 docker/metadata-action#284
Bump csv-parse from 5.3.3 to 5.3.8 in docker/metadata-action#271 docker/metadata-action#286
Bump moment-timezone from 0.5.40 to 0.5.43 in docker/metadata-action#268 docker/metadata-action#278 docker/metadata-action#281
Bump semver from 7.4.0 to 7.5.0 in docker/metadata-action#285
Full Changelog: docker/[email protected]

v4.3.0
Provide outputs as env vars by @​crazy-max (#257)
Full Changelog: docker/[email protected]

v4.2.0
Add tz attribute to handlebar date function by @​chroju (#251)
Bump minimatch from 3.0.4 to 3.1.2 (#242)
Bump csv-parse from 5.3.1 to 5.3.3 (#245)
Bump json5 from 2.2.0 to 2.2.3 (#252)
Full Changelog: docker/[email protected]

v4.1.1
Revert changes to set associated head sha on pull request event by @​crazy-max (#239)
User can still set associated head sha on PR by setting the env var DOCKER_METADATA_PR_HEAD_SHA=true
Bump csv-parse from 5.3.0 to 5.3.1 (#237)
Full Changelog: docker/[email protected]

... (truncated)

Ref #2332
julio-lopez added a commit to kanisterio/kanister that referenced this pull request Sep 14, 2023
* Bump docker/build-push-action from 4 to 5

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* deps(gha): use commit id for docker/build-push-action version

* deps(gha): use commit id for docker/login-action version

* deps(gha): use commit id for docker/metadata-action version

Upgrades the action to 96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0

Release notes:

Release notes
Sourced from docker/metadata-action's releases.

v5.0.0
Node 20 as default runtime (requires Actions Runner v2.308.0 or later) by @​crazy-max in docker/metadata-action#328
Bump @​actions/core from 1.10.0 to 1.10.1 in docker/metadata-action#333
Bump csv-parse from 5.4.0 to 5.5.0 in docker/metadata-action#320
Bump semver from 7.5.1 to 7.5.2 in docker/metadata-action#304
Bump handlebars from 4.7.7 to 4.7.8 in docker/metadata-action#315
Full Changelog: docker/[email protected]

v4.6.0
Dedup and sort labels by @​crazy-max in docker/metadata-action#301
Bump @​docker/actions-toolkit from 0.3.0 to 0.5.0 in docker/metadata-action#302
Full Changelog: docker/[email protected]

v4.5.0
Bump @​docker/actions-toolkit from 0.1.0 to 0.3.0 in docker/metadata-action#296
Bump csv-parse from 5.3.8 to 5.4.0 in docker/metadata-action#294
Full Changelog: docker/[email protected]

v4.4.0
Add context input to define the metadata provider by @​neilime in docker/metadata-action#248
Switch to actions-toolkit implementation by @​crazy-max in docker/metadata-action#266 docker/metadata-action#273 docker/metadata-action#284
Bump csv-parse from 5.3.3 to 5.3.8 in docker/metadata-action#271 docker/metadata-action#286
Bump moment-timezone from 0.5.40 to 0.5.43 in docker/metadata-action#268 docker/metadata-action#278 docker/metadata-action#281
Bump semver from 7.4.0 to 7.5.0 in docker/metadata-action#285
Full Changelog: docker/[email protected]

v4.3.0
Provide outputs as env vars by @​crazy-max (#257)
Full Changelog: docker/[email protected]

v4.2.0
Add tz attribute to handlebar date function by @​chroju (#251)
Bump minimatch from 3.0.4 to 3.1.2 (#242)
Bump csv-parse from 5.3.1 to 5.3.3 (#245)
Bump json5 from 2.2.0 to 2.2.3 (#252)
Full Changelog: docker/[email protected]

v4.1.1
Revert changes to set associated head sha on pull request event by @​crazy-max (#239)
User can still set associated head sha on PR by setting the env var DOCKER_METADATA_PR_HEAD_SHA=true
Bump csv-parse from 5.3.0 to 5.3.1 (#237)
Full Changelog: docker/[email protected]

... (truncated)

Ref #2332

* deps(gha): upgrade the setup-buildx-action to v3.0.0

Uses commit id for docker/setup-buildx-action version

Release notes at https://github.com/docker/setup-buildx-action/releases/tag/v3.0.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Julio <[email protected]>
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.

Add option to choose between git or workflow context to generate metadata
4 participants