-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Allow overwrite and ref targets. Adds more functionality / flexibility to action #14
base: main
Are you sure you want to change the base?
Changes from all commits
d660e47
7e7e3ce
aa10244
af134af
f6ff252
e784ba8
adab31b
b6bf63c
9a33dfe
2c8d36f
f110b45
c3b8c44
4215f06
31cbb32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/** |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,13 @@ It would be more useful to use this with other GitHub Actions' outputs. | |
|
||
## Inputs | ||
|
||
| NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT | | ||
| --------- | -------------------------- | -------- | -------- | ------- | | ||
| `tag` | A Git tag name. | `string` | `true` | `N/A` | | ||
| `message` | A message for the Git tag. | `string` | `false` | `''` | | ||
| NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT | | ||
| ------------ | -------------------------------------- | -------- | -------- | ------- | | ||
| `tag` | A Git tag name. | `string` | `true` | `N/A` | | ||
| `message` | A message for the Git tag. | `string` | `false` | `''` | | ||
| `ref` | Commit SHA or tag to target. | `string` | `false` | `''` | | ||
| `force` | A message for the Git tag. | `boolean`| `false` | `false` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix description There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix desciption of the |
||
| `always-pass`| If step should pass if tag push fails | `boolean`| `false` | `false` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
## Example | ||
|
||
|
@@ -34,13 +37,13 @@ jobs: | |
- uses: actions-ecosystem/action-get-latest-tag@v1 | ||
id: get-latest-tag | ||
|
||
- uses: actions-ecosystem/action-bump-semver@v1 | ||
- uses: thejeff77/action-bump-semver@v1.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 about use of |
||
id: bump-semver | ||
with: | ||
current_version: ${{ steps.get-latest-tag.outputs.tag }} | ||
level: minor | ||
|
||
- uses: actions-ecosystem/action-push-tag@v1 | ||
- uses: thejeff77/action-push-tag@v1.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. +1 about use of |
||
with: | ||
tag: ${{ steps.bump-semver.outputs.new_version }} | ||
message: '${{ steps.bump-semver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,63 @@ | ||
name: Actions Ecosystem Action Push Tag | ||
description: Push a Git tag. | ||
author: Actions Ecosystem | ||
name: Push Any Git Tag | ||
description: based on Actions Ecosystem Push Tag - Fixed with additional features. | ||
author: Actions Ecosystem & theJeff77 | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't change these. Nor do you need to put your name in as the author just because you PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
|
||
inputs: | ||
tag: | ||
description: A Git tag name. | ||
type: string | ||
required: true | ||
message: | ||
description: A message for the Git tag. | ||
type: string | ||
required: false | ||
ref: | ||
description: Commit SHA or ref (tag) to target for the tag. | ||
type: string | ||
required: false | ||
force: | ||
description: Whether or not to force push (overwrite) the tag if it already exists. Useful for walking tags. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This descriptions are not available for me when I read the docs or trying to see it will work for me |
||
type: boolean | ||
required: false | ||
default: false | ||
always-pass: | ||
description: If this build step should pass no matter what if ref is missing and the tag push fails. | ||
type: boolean | ||
required: false | ||
default: false | ||
runs: | ||
using: docker | ||
image: Dockerfile | ||
using: "composite" | ||
steps: | ||
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this is an unnecessary over reach on this PR. Just leave it in the Dockerfile and make your changes in the entrypoint.sh. |
||
- name: Tag | ||
shell: bash | ||
run: | | ||
tag=${{ inputs.tag }} | ||
message=${{ inputs.message }} | ||
ref=${{ inputs.ref }} | ||
force=${{ inputs.force }} | ||
alwaysPass=${{ inputs.always-pass }} | ||
|
||
if [ "$force" = "true" ]; then | ||
force="-f" | ||
else | ||
unset force | ||
fi | ||
|
||
if [ "$always-pass" = "true" ]; then | ||
alwaysPass=" || true" | ||
else | ||
unset alwaysPass | ||
fi | ||
|
||
if [ -z "$ref" ]; then | ||
ref="HEAD" | ||
fi | ||
|
||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
|
||
git tag -a "${tag}" "${ref}" -m "${message}" ${force} ${alwaysPass} | ||
git push origin "${tag}" ${force} ${alwaysPass} | ||
branding: | ||
icon: search | ||
color: yellow |
This file was deleted.
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.
It will be nice to update example in the README.MD with an real case where you use all the new parameters.
For example: it's not clear if the
force
parameter is analog of git force or it's something else. And why would I need aref