From ef9c3c14d3b424b7fa9c9e95b5d8e72c852b0e58 Mon Sep 17 00:00:00 2001 From: Romain Lebran Date: Fri, 1 Sep 2023 15:51:53 +0200 Subject: [PATCH] Update gitlog to remove crate parameter. Update build badge link --- .github/actions/gitlog/action.yaml | 5 +---- .github/actions/gitlog/gitlog.sh | 29 ++--------------------------- README.md | 4 ++-- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/.github/actions/gitlog/action.yaml b/.github/actions/gitlog/action.yaml index b4a4e9b..b21a458 100644 --- a/.github/actions/gitlog/action.yaml +++ b/.github/actions/gitlog/action.yaml @@ -4,9 +4,6 @@ inputs: output-file: description: File path where to place the content of the changed commits required: true - crate: - description: Name of the crate to get git log for - required: true outputs: last_release: description: Last release commit or first commit of history @@ -17,4 +14,4 @@ runs: - shell: bash id: gitlog run: | - ${{ github.action_path }}/gitlog.sh --output-file ${{ inputs.output-file }} --crate ${{ inputs.crate }} + ${{ github.action_path }}/gitlog.sh --output-file ${{ inputs.output-file }} diff --git a/.github/actions/gitlog/gitlog.sh b/.github/actions/gitlog/gitlog.sh index c8a06e1..53df6ba 100755 --- a/.github/actions/gitlog/gitlog.sh +++ b/.github/actions/gitlog/gitlog.sh @@ -3,7 +3,6 @@ # This mangles git log entries for change lop purposes output_file="" -crate="" while true; do case $1 in "--output-file") @@ -11,11 +10,6 @@ while true; do output_file="$1" shift ;; - "--crate") - shift - crate="$1" - shift - ;; *) break ;; @@ -25,12 +19,9 @@ done if [[ "$output_file" == "" ]]; then echo "Missing --output-file option argument, define path to file or - for stdout" && exit 1 fi -if [[ "$crate" == "" ]]; then - echo "Missing --crate option argument, need an explisit crate to get git log for" && exit 1 -fi from_commit=HEAD -last_release=$(git tag --sort=-committerdate | grep -E "$crate-[0-9]*\.[0-9]*\.[0-9]*" | head -1) +last_release=$(git tag --sort=-committerdate | head -1) echo "Found tag: $last_release" if [[ "$last_release" == "" ]]; then last_release=$(git tag --sort=-committerdate | head -1) # get last tag @@ -51,26 +42,10 @@ fi mapfile -t log_lines < <(git log --pretty=format:'(%h) %s' $ancestry_path $commit_range) -function is_crate_related { - commit="$1" - changes="$(git diff --name-only "$commit"~ "$commit" | awk -F / '{print $1}' | xargs)" - - is_related=false - if [[ "$changes" == *"$crate"* ]]; then - is_related=true - fi - - echo $is_related -} - log="" for line in "${log_lines[@]}"; do commit=$(echo "$line" | awk -F ' ' '{print $1}') commit=${commit//[\(\)]/} - - if [[ $(is_crate_related "$commit") == true ]]; then - log=$log"* $line\n" - fi done if [[ "$output_file" != "" ]]; then @@ -84,4 +59,4 @@ fi if [[ "$last_release" == "" ]]; then last_release=$(git rev-list --reverse HEAD | head -1) fi -echo "::set-output name=last_release::$last_release" \ No newline at end of file +echo "::set-output name=last_release::$last_release" diff --git a/README.md b/README.md index 992dd31..d0d2697 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ [docs.rs]: https://docs.rs/garde-actix-web/latest/garde-actix-web/ [crates.io]: https://crates.io/crates/garde-actix-web -[build]: https://github.com/rlebran-netwo/garde-actix-web/actions/workflows/build.yaml?branch=main +[build]: https://github.com/netwo-io/garde-actix-web/actions/workflows/build.yaml?branch=main [Documentation]: https://img.shields.io/docsrs/garde-actix-web [Latest Version]: https://img.shields.io/crates/v/garde-actix-web.svg -[Build Status]: https://github.com/rlebran-netwo/garde-actix-web/actions/workflows/build.yaml/badge.svg?branch=main +[Build Status]: https://github.com/netwo-io/garde-actix-web/actions/workflows/build.yaml/badge.svg?branch=main Actix-web wrapper for [garde](https://github.com/jprochazk/garde), a Rust validation library.