mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
chore(project): add action files
This commit is contained in:
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM orhunp/git-cliff:latest
|
||||
|
||||
LABEL maintainer="orhun <orhunparmaksiz@gmail.com>"
|
||||
LABEL repository="https://github.com/orhun/git-cliff-action"
|
||||
LABEL homepage="https://github.com/orhun/git-cliff"
|
||||
|
||||
LABEL com.github.actions.name="Changelog Generator"
|
||||
LABEL com.github.actions.description="Generate changelog based on your Git history"
|
||||
LABEL com.github.actions.icon="triangle"
|
||||
LABEL com.github.actions.color="orange"
|
||||
|
||||
COPY README.md /
|
||||
COPY LICENSE /
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
34
README.md
Normal file
34
README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# git-cliff changelog generator action
|
||||
|
||||
This action generates a changelog based on your Git history using [git-cliff](https://github.com/orhun/git-cliff), on the fly!
|
||||
|
||||
## Usage
|
||||
|
||||
### Inputs
|
||||
|
||||
* `args`: Arguments to pass to git-cliff. Default `"-v"`
|
||||
|
||||
### Outputs
|
||||
|
||||
* `changelog`: The generated changelog.
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
- name: Changelog Generator
|
||||
uses: orhun/git-cliff-action@v1
|
||||
with:
|
||||
args: --verbose
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
This action is based on [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) and uses [git-cliff](https://github.com/orhun/git-cliff).
|
||||
|
||||
## License
|
||||
|
||||
GNU General Public License ([v3.0](https://www.gnu.org/licenses/gpl.txt))
|
||||
|
||||
## Copyright
|
||||
|
||||
Copyright © 2021, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)
|
||||
18
action.yml
Normal file
18
action.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
name: "git-cliff: Changelog Generator"
|
||||
description: "Generate changelog based on your Git history"
|
||||
inputs:
|
||||
args:
|
||||
description: "git-cliff arguments"
|
||||
required: false
|
||||
default: "-v"
|
||||
outputs:
|
||||
changelog:
|
||||
description: 'generated changelog'
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
||||
args:
|
||||
- ${{ inputs.args }}
|
||||
branding:
|
||||
icon: "triangle"
|
||||
color: "orange"
|
||||
21
entrypoint.sh
Executable file
21
entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash -l
|
||||
set -uxo pipefail
|
||||
|
||||
CHANGELOG_OUT=${CHANGELOG_OUT:="git-cliff/CHANGELOG.md"}
|
||||
|
||||
# Create the output directory
|
||||
mkdir -p "$(dirname $CHANGELOG_OUT)"
|
||||
|
||||
# Execute git-cliff
|
||||
git-cliff "$@" > "$CHANGELOG_OUT"
|
||||
exit_code=$?
|
||||
changelog=$(cat "$CHANGELOG_OUT")
|
||||
|
||||
# Output to console
|
||||
echo "$changelog"
|
||||
|
||||
# Set output
|
||||
echo "::set-output name=changelog::$changelog"
|
||||
|
||||
# Pass exit code to the next step
|
||||
echo ::set-output name=exit_code::$exit_code
|
||||
Reference in New Issue
Block a user