Skip to content

Commit

Permalink
fix: upgraded changie action version, fixed changelog body issue
Browse files Browse the repository at this point in the history
  • Loading branch information
demeyerthom committed Nov 14, 2023
1 parent f4c001f commit 4a1f18a
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@ runs:

- name: Output changes
if: steps.status.outputs.create_release == 'true'
uses: miniscruff/changie-action@5c210bdd35a94db41b37513e3e7c2b4dc1e7a4e9 # v1.0.1
uses: miniscruff/changie-action@v2
id: changelog
with:
version: latest
args: batch --dry-run auto

- name: Batch changes
if: steps.status.outputs.create_release == 'true'
uses: miniscruff/changie-action@5c210bdd35a94db41b37513e3e7c2b4dc1e7a4e9 # v1.0.1
uses: miniscruff/changie-action@v2
with:
version: latest
args: batch auto

- name: Merge changes
if: steps.status.outputs.create_release == 'true'
uses: miniscruff/changie-action@5c210bdd35a94db41b37513e3e7c2b4dc1e7a4e9 # v1.0.1
uses: miniscruff/changie-action@v2
with:
version: latest
args: merge

- name: Get the latest version
id: latest
if: steps.status.outputs.create_release == 'true' || steps.status.outputs.is_release == 'true'
uses: miniscruff/changie-action@5c210bdd35a94db41b37513e3e7c2b4dc1e7a4e9 # v1.0.1
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest
Expand Down Expand Up @@ -107,45 +107,33 @@ runs:
if: steps.status.outputs.is_release == 'true'
uses: actions/github-script@v6
env:
version: ${{ steps.latest.outputs.output }}
VERSION: ${{ steps.latest.outputs.output }}
with:
github-token: ${{ inputs.github-token }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.version}`,
ref: `refs/tags/${process.env.VERSION}`,
sha: context.sha
})
- name: Create release notes
if: steps.status.outputs.is_release == 'true'
shell: bash
id: release-notes
run: |
BODY=$(cat .changes/${{ steps.latest.outputs.output }}.md | sed -n '1!p')
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "body<<$EOF" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Create GitHub release
if: steps.status.outputs.is_release == 'true'
# if: steps.status.outputs.is_release == 'true'
uses: actions/github-script@v6
env:
version: ${{ steps.latest.outputs.output }}
GITHUB_RELEASE_BODY: ${{ steps.release-notes.outputs.body }}
VERSION: ${{ steps.latest.outputs.output }}
GITHUB_RELEASE_BODY: ${{ steps.changelog.outputs.output }}
with:
github-token: ${{ inputs.github-token }}
retries: 3
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
name: process.env.version,
name: process.env.VERSION,
body: process.env.GITHUB_RELEASE_BODY,
tag_name: process.env.version,
tag_name: process.env.VERSION,
draft: false,
})
Expand Down

0 comments on commit 4a1f18a

Please sign in to comment.