Skip to content

Commit

Permalink
tiedemann/changelog action fix (#222)
Browse files Browse the repository at this point in the history
- **fix: add clean parameter to checkout action**
- **fix: add clean and checkout option to changelog action**

supercedes #220

---------

Co-authored-by: Yannick Röder <[email protected]>
  • Loading branch information
DerTiedemann and yannick-roeder authored Nov 27, 2024
1 parent 95cf59b commit d32d590
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bump-version-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false # required for pushing to protected branch later
fetch-depth: 0 # required for changelog generation

- name: Bump version
id: bump-version
Expand Down
10 changes: 10 additions & 0 deletions actions/changelog-generate/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ inputs:
description: Path to the changelog file in the GitHub repository
required: false
default: "CHANGELOG.md"
checkout:
description: "Whether to checkout the repository or not."
required: false
default: "false"
clean:
description: "Clean the repository before running the action."
required: false
default: "false"

outputs:
merged-changelog:
Expand All @@ -27,8 +35,10 @@ runs:
steps:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
if: ${{ inputs.checkout == 'true' }}
with:
fetch-depth: 0
clean: ${{ inputs.clean }}
- name: Get config path
id: get-config-path
run: |
Expand Down
5 changes: 5 additions & 0 deletions actions/checkout/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
description: "Whether LFS files should be cached. Only has an effect if lfs=true."
required: false
default: "true"
clean:
description: "Clean the repository before running the action."
required: false
default: "true"
submodules:
description: "Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules."
required: false
Expand All @@ -46,6 +50,7 @@ runs:
persist-credentials: ${{ inputs.persist-credentials }}
submodules: ${{ inputs.submodules }}
fetch-depth: ${{ inputs.fetch-depth }}
clean: ${{ inputs.clean }}

- name: Create LFS file list
if: ${{ inputs.lfs == 'true'}}
Expand Down
2 changes: 2 additions & 0 deletions docs/actions/changelog-generate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ steps:
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| -------------- | ------ | -------- | ---------------- | --------------------------------------------------- |
| changelog-file | string | false | `"CHANGELOG.md"` | Path to the changelog file in the GitHub repository |
| checkout | string | false | `"false"` | Whether to checkout the repository or not. |
| clean | string | false | `"false"` | Clean the repository before running the action. |
| github-token | string | true | | The GitHub token for committing the changes. |
| tag | string | true | | Version after bump |
Expand Down
1 change: 1 addition & 0 deletions docs/actions/checkout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ steps:
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| ------------------- | ------ | -------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| cache | string | false | `"true"` | Whether LFS files should be cached. Only has an effect if lfs=true. |
| clean | string | false | `"true"` | Clean the repository before running the action. |
| fetch-depth | string | false | `"1"` | Number of commits to fetch. 0 indicates all history for all branches and tags |
| lfs | string | false | `"false"` | Whether LFS files of the repository should be checked out |
| persist-credentials | string | false | `"true"` | Whether to configure the token or SSH key with the local git config |
Expand Down

0 comments on commit d32d590

Please sign in to comment.