Skip to content

Commit a7de905

Browse files
Upgrade CLI and use --compare-url-target-revision option (#7)
* Update CLI * Use --compare-url-target-revision in entrypoint.sh * Update README
1 parent 91aeae2 commit a7de905

File tree

5 files changed

+112
-43
lines changed

5 files changed

+112
-43
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Action is best used in a Workflow that listens to the `release`-event and th
1818

1919
The following is an example Workflow ready to be used.
2020

21-
The Workflow checks out the default `main`-branch of your repository, updates the `./CHANGELOG.md`-file with the name and the contents of the just released release and commits the changes back to your repository using [git-auto-commit](https://github.com/stefanzweifel/git-auto-commit-action).
21+
The Workflow checks out [the target branch of the release](https://docs.github.com/en/rest/reference/releases#create-a-release--parameters), updates the `./CHANGELOG.md`-file with the name and the contents of the just released release and commits the changes back to your repository using [git-auto-commit](https://github.com/stefanzweifel/git-auto-commit-action).
2222

2323
```yaml
2424
# .github/workflows/update-changelog.yaml
@@ -36,7 +36,7 @@ jobs:
3636
- name: Checkout code
3737
uses: actions/checkout@v2
3838
with:
39-
ref: main
39+
ref: ${{ github.event.release.target_commitish }}
4040

4141
- name: Update Changelog
4242
uses: stefanzweifel/changelog-updater-action@v1
@@ -47,7 +47,7 @@ jobs:
4747
- name: Commit updated CHANGELOG
4848
uses: stefanzweifel/git-auto-commit-action@v4
4949
with:
50-
branch: main
50+
branch: ${{ github.event.release.target_commitish }}
5151
commit_message: Update CHANGELOG
5252
file_pattern: CHANGELOG.md
5353
```

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
required: false
1919
default: CHANGELOG.md
2020
description: Defaults to `CHANGELOG.md`. Path to CHANGELOG.md file.
21+
compare-url-target-revision:
22+
required: false
23+
default: HEAD
24+
description: Target revision used in compare URL inside a possible "Unreleased" heading.
2125

2226
branding:
2327
icon: copy
@@ -31,3 +35,4 @@ runs:
3135
- ${{ inputs.latest-version }}
3236
- ${{ inputs.release-date }}
3337
- ${{ inputs.path-to-changelog }}
38+
- ${{ inputs.compare-url-target-revision }}

changelog-updater

-7.79 MB
Binary file not shown.

composer.lock

Lines changed: 103 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ php /changelog-updater update \
55
--latest-version="$2" \
66
--release-date="$3" \
77
--path-to-changelog="$4" \
8+
--compare-url-target-revision="$5"
89
--write

0 commit comments

Comments
 (0)