From 9f4000be7a7cdaa0f412865ab25f9aa42c09e18f Mon Sep 17 00:00:00 2001 From: Sewer56 Date: Sun, 16 Jun 2024 06:57:11 +0100 Subject: [PATCH] Added: Ability to specify a custom name for the Changelog Artifact --- .github/workflows/test-changelog-workflow.yml | 68 +++++++++++++------ README.MD | 15 ++-- action.yml | 6 +- 3 files changed, 59 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-changelog-workflow.yml b/.github/workflows/test-changelog-workflow.yml index 101a479..1689804 100644 --- a/.github/workflows/test-changelog-workflow.yml +++ b/.github/workflows/test-changelog-workflow.yml @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/README.MD b/README.MD index 33963da..c7f730d 100644 --- a/README.MD +++ b/README.MD @@ -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 diff --git a/action.yml b/action.yml index 3fee426..4b1b3cb 100644 --- a/action.yml +++ b/action.yml @@ -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" @@ -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