Skip to content

Commit

Permalink
Expanding the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
metcalfc committed Mar 28, 2020
1 parent 5d166e3 commit 04c0fe7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v2
# Fetch all tags
# By default the checkout is shallow. Fetch all tags, branches, and history.
- run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,25 @@ Markdown formatted changelog.

## Example usage

There are three blocks you will need. The first is an additional run block after your checkout. By default an action checkout is shallow. So add:

- name: Checkout
uses: actions/checkout@v2
# By default the checkout is shallow. Fetch all tags, branches, and history.
- run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git fetch --prune --unshallow

Next you will need to generate the changelog itself. To get the changelog between the SHA of the commit that triggered the action and the tag of the latest release:

- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v0.0.1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

Or
Or if you have two specific references you want:

- name: Generate changelog
id: changelog
Expand All @@ -36,4 +48,9 @@ Or
head-ref: 'v0.0.2'
base-ref: 'v0.0.1'

Lastly you need to use the changelog.

- name: Get the changelog
run: echo "${{ steps.changelog.outputs.changelog }}"

Why do we need `myToken`? Read more here: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret

0 comments on commit 04c0fe7

Please sign in to comment.