Skip to content

Commit

Permalink
Fix require-changelog-entry temporary checkout steps (#33)
Browse files Browse the repository at this point in the history
* fix GHA README examples

* add checkout_path to require-changelog-entry

* reference inputs correctly

* add changelog entry
  • Loading branch information
alehechka authored May 7, 2023
1 parent ef23f1f commit 6b0651f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion autoreleaser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: changelog
uses: lockerstock/github-actions/autoreleaser@main
with:
token: ${{ secret.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
changelog_path: CHANGELOG.md
```
Expand Down
3 changes: 2 additions & 1 deletion require-changelog-entry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: changelog
uses: lockerstock/github-actions/require-changelog-entry@main
with:
token: ${{ secret.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
changelog_path: CHANGELOG.md

- name: 'Error if no Changelog entry'
Expand All @@ -40,6 +40,7 @@ jobs:
| - | - | - | - |
| token | GITHUB_TOKEN to access the GitHub API if the repository is private | `true` | |
| default_branch | Default branch to compare the "Unreleased" section of the CHANGELOG to. | `false` | ${{ github.event.repository.default_branch }} |
| checkout_path | This action checks out the repository for the current SHA as well as from the default branch. This path indicates where to checkout the repositories as to not clash with any other work in the workflow. | `false` | temp/require-changelog-entry |
| tag_prefix | Optional prefix string to apply to tag search | `false` | |
| tag_suffix | Optional suffix string to apply to tag search | `false` | |
| changelog_path | Path to CHANGELOG file within repository | `false` | CHANGELOG.md |
Expand Down
15 changes: 10 additions & 5 deletions require-changelog-entry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ inputs:
default: ${{ github.event.repository.default_branch }}
required: false

checkout_path:
description: This action checks out the repository for the current SHA as well as from the default branch. This path indicates where to checkout the repositories as to not clash with any other work in the workflow.
default: temp/require-changelog-entry
required: false

tag_prefix:
description: Optional prefix string to apply to tag search
required: false
Expand Down Expand Up @@ -89,14 +94,14 @@ runs:
uses: actions/checkout@v3
with:
token: ${{ inputs.token }}
path: ${{ github.action_path }}/current
path: ${{ inputs.checkout_path }}/current

- name: Checkout Repository at default branch
uses: actions/checkout@v3
with:
token: ${{ inputs.token }}
ref: ${{ inputs.default_branch }}
path: ${{ github.action_path }}/default
path: ${{ inputs.checkout_path }}/default

###### Retrieve latest and Unreleased entries from CHANGELOGs ######

Expand All @@ -105,22 +110,22 @@ runs:
uses: mindsers/changelog-reader-action@v2
with:
validation_level: none
path: ${{ github.action_path }}/current/${{ inputs.changelog_path }}
path: ${{ inputs.checkout_path }}/current/${{ inputs.changelog_path }}

- name: Get Current Unreleased Changelog Entry
id: current_unreleased
uses: mindsers/changelog-reader-action@v2
with:
validation_level: none
path: ${{ github.action_path }}/current/${{ inputs.changelog_path }}
path: ${{ inputs.checkout_path }}/current/${{ inputs.changelog_path }}
version: Unreleased

- name: Get Default Unreleased Changelog Entry
id: default_unreleased
uses: mindsers/changelog-reader-action@v2
with:
validation_level: none
path: ${{ github.action_path }}/default/${{ inputs.changelog_path }}
path: ${{ inputs.checkout_path }}/default/${{ inputs.changelog_path }}
version: Unreleased

###### Prepare Latest Tag ######
Expand Down
6 changes: 6 additions & 0 deletions require-changelog-entry/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [v0.2.1]

### Fixed

- Invalid checkout process on `${{ github.action_path }}` path.

## [v0.2.0]

### Added
Expand Down

0 comments on commit 6b0651f

Please sign in to comment.