Skip to content

Commit

Permalink
Added: Ability to specify a custom name for the Changelog Artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jun 16, 2024
1 parent 06edc6d commit 9f4000b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 30 deletions.
68 changes: 46 additions & 22 deletions .github/workflows/test-changelog-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,49 @@ jobs:
exit 1
fi
test-upload-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test Upload Artifact
uses: Reloaded-Project/devops-changelog@v1
with:
upload-artifact: true
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: Changelog
- name: Assert Downloaded Artifact Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "Downloaded CHANGELOG.md artifact is empty"
exit 1
fi
test-upload-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
uses: Reloaded-Project/devops-changelog@v1
with:
upload-artifact: true
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: Changelog
- name: Assert Downloaded Artifact Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "Downloaded CHANGELOG.md artifact is empty"
exit 1
fi
test-custom-artifact-name:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
uses: Reloaded-Project/devops-changelog@v1
with:
upload-artifact: true
artifact-name: Custom_Changelog
- name: Download Custom Artifact
uses: actions/download-artifact@v4
with:
name: Custom_Changelog
- name: Assert Downloaded Custom Artifact Not Empty
shell: bash
run: |
if [ ! -s "CHANGELOG.md" ]; then
echo "Downloaded custom CHANGELOG.md artifact is empty"
exit 1
fi
15 changes: 8 additions & 7 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ The following flags are directly passed to the underlying [auto-changelog tool][

And the following parameters are specific to this workflow.

| Input | Required | Default | Description |
| --------------------------- | -------- | ------- | ------------------------------------------------------------------------------ |
| `upload-artifact` | No | `false` | Upload the generated changelog as an artifact |
| `upload-release` | No | `false` | Upload the generated changelog to GitHub Releases |
| `is-release` | No | `false` | Whether this is a GitHub Release |
| `release-tag` | No | `""` | Tag associated with the GitHub Release |
| `override-starting-version` | No | `false` | Override the starting version with the release tag if this is a GitHub Release |
| Input | Required | Default | Description |
| --------------------------- | -------- | ----------- | ------------------------------------------------------------------------------ |
| `upload-artifact` | No | `false` | Upload the generated changelog as an artifact |
| `artifact-name` | No | `Changelog` | Name of the artifact for the uploaded changelog. |
| `upload-release` | No | `false` | Upload the generated changelog to GitHub Releases |
| `is-release` | No | `false` | Whether this is a GitHub Release |
| `release-tag` | No | `""` | Tag associated with the GitHub Release |
| `override-starting-version` | No | `false` | Override the starting version with the release tag if this is a GitHub Release |

## Extra Examples

Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ inputs:
required: false
default: "false"
description: "Override the starting version with the release tag if this is a GitHub Release"
artifact-name:
required: false
default: "Changelog"
description: "Override the artifact name for the changelog"

runs:
using: "composite"
Expand Down Expand Up @@ -313,7 +317,7 @@ runs:
uses: actions/upload-artifact@v4
if: ${{ inputs.upload-artifact == 'true' }}
with:
name: Changelog
name: ${{ inputs.artifact-name }}
path: ${{ inputs.output }}

- name: Upload Changelog to GitHub Release
Expand Down

0 comments on commit 9f4000b

Please sign in to comment.