Skip to content

Commit

Permalink
Cleanup from ncc revert.
Browse files Browse the repository at this point in the history
  • Loading branch information
metcalfc committed Nov 22, 2021
1 parent 0fe53bf commit a76f2c1
Show file tree
Hide file tree
Showing 4 changed files with 3,246 additions and 1,151 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Expand Up @@ -10,22 +10,22 @@ jobs:
uses: actions/checkout@v2
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@reverse
uses: metcalfc/changelog-generator@main
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: 'v0.0.2'
base-ref: 'v0.0.1'
- name: Reverse the generated changelog
id: changelog-rev
uses: metcalfc/changelog-generator@reverse
uses: metcalfc/changelog-generator@main
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: 'v0.0.2'
base-ref: 'v0.0.1'
reverse: 'true'
- name: Explicitly do not reverse the generated changelog
id: changelog-notrev
uses: metcalfc/changelog-generator@reverse
uses: metcalfc/changelog-generator@main
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: 'v0.0.2'
Expand Down
11 changes: 7 additions & 4 deletions dist/changelog.sh
Expand Up @@ -4,10 +4,10 @@ set -eou pipefail
head_ref=$1
base_ref=$2
repo_url=$3
extra_flags=""

reverse = ""
if [ $strval1 != "true" ]; then
reverse = "--reverse"
if [ "$4" == "true" ]; then
extra_flags='--reverse'
fi

# By default a GitHub action checkout is shallow. Get all the tags, branches,
Expand All @@ -25,9 +25,12 @@ then
base_ref=$(git rev-list --max-parents=0 HEAD)
fi

# Bash quoting will get you. Do not quote the extra_flags. If its null
# we want it to disappear. If you quote it, it will go to git as an ""
# and thats not a valid arg.
log=$(git log "${base_ref}...${head_ref}" \
--pretty=format:"- [%h](http://github.com/${repo_url}/commit/%H) - %s" \
${reverse})
${extra_flags})

if [ -z "$log" ];
then
Expand Down

0 comments on commit a76f2c1

Please sign in to comment.