diff --git a/.github/workflows/python-poetry-release.yaml b/.github/workflows/python-poetry-release.yaml index 08934cbc5..9c7bf2313 100644 --- a/.github/workflows/python-poetry-release.yaml +++ b/.github/workflows/python-poetry-release.yaml @@ -7,30 +7,30 @@ on: description: "Scope of the release; See: https://python-poetry.org/docs/cli/#version" required: true type: string - ref: - description: "The ref name to checkout the repository." + changelog: + description: "Create changelog for release." required: false - default: ${{ github.event.repository.default_branch }} - type: string - python-version: - description: "The Python version for setting up Poetry. (Default is 3.10)" + default: true + type: boolean + changelog-config: + description: "Changelog config path." required: false - default: "3.10" + default: "" type: string poetry-version: description: "The Poetry version to be installed. (Default is 1.5.1)" required: false default: "1.5.1" type: string - changelog: - description: "Create changelog for release." + python-version: + description: "The Python version for setting up Poetry. (Default is 3.10)" required: false - default: true - type: boolean - changelog-config: - description: "Changelog config path." + default: "3.10" + type: string + ref: + description: "The ref name to checkout the repository." required: false - default: "" + default: ${{ github.event.repository.default_branch }} type: string working-directory: description: "The working directory of your Python package. (Default is root directory)" @@ -85,7 +85,7 @@ jobs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.35.0 + uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 if: ${{ inputs.changelog == true}} with: github-token: ${{ secrets.github-token }} diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index c614f6eaf..9074bf48f 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -8,7 +8,6 @@ inputs: new-tag: description: Version after bump required: true - # optional inputs changelog-file: description: Path to the changelog file in the GitHub repository @@ -73,12 +72,14 @@ runs: setfrom=$(git rev-list --max-parents=0 HEAD) fi fi + echo "fromtag=$setfrom">> $GITHUB_OUTPUT - if [ -n "${{ inputs.config }}" ]; then - path="$GITHUB_ACTION_PATH/changelog-config.json)" + if [[ -z "${{ inputs.config }}" ]]; then + path="$GITHUB_ACTION_PATH/changelog-config.json" else path=${{ inputs.config }} fi + if [ ! -f "$path" ]; then echo "changelog config file $path doesn't exist" exit 1 @@ -115,9 +116,11 @@ runs: id: output-generator run: | # Reformat ${{ runner.temp }}/changes.md and add it to the existing changelog - echo 'single-changelog<> $GITHUB_OUTPUT - cat ${{ runner.temp }}/changes.md >> $GITHUB_OUTPUT - echo 'EOF' >> $GITHUB_OUTPUT + { + echo 'single-changelog<> $GITHUB_OUTPUT # Create changelog.md in case of a first Release if [ -n "${{ inputs.changelog-file }}" ]; then @@ -130,8 +133,10 @@ runs: # Update global changelog and pass it to the ouput sed -i "2i $(sed ':a;N;$!ba;s/\n/\\n/g' ${{ runner.temp }}/changes.md)" ${{ inputs.changelog-file }} - echo 'merged-changelog<> $GITHUB_OUTPUT - cat ${{ inputs.changelog-file }} >> $GITHUB_OUTPUT - echo 'EOF' >> $GITHUB_OUTPUT + { + echo 'merged-changelog<> $GITHUB_OUTPUT fi shell: bash