Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
ci(GITHUB): script changelog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Jun 18, 2022
1 parent 966ce63 commit 1937a76
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/scripts/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -eo pipefail

main() {

echo "{}" > package.json
TAG="$(git tag | sort --version-sort | tail -n 2 | head -n 1)"
CHANGE_LOG_CONTENT="$(npx -q generate-changelog -f - -t "${TAG}")"

{
echo "CHANGE_LOG_CONTENT<<EOF"
echo "${CHANGE_LOG_CONTENT}"
echo "EOF"
} >> "$GITHUB_ENV"

rm package.json

}

main
12 changes: 4 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,15 @@ jobs:
if: contains(github.ref, '/tags/v')
run: |
source ./.github/scripts/setup.sh
echo "{}" > package.json
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: Release -- Generate Changelog
if: contains(github.ref, '/tags/v')
uses: scottbrenner/[email protected]
id: Changelog
env:
REPO: ${{ github.repository }}
run:
source ./.github/scripts/changelog.sh

- name: Release -- Create Github Release
- name: Release -- Create GitHub Release
if: contains(github.ref, '/tags/v')
uses: actions/create-release@v1
env:
Expand All @@ -54,7 +51,7 @@ jobs:
tag_name: ${{ env.BRANCH_OR_TAG }}
release_name: Release ${{ env.BRANCH_OR_TAG }}
body: |
${{ steps.Changelog.outputs.changelog }}
${{ env.CHANGE_LOG_CONTENT }}
draft: true
prerelease: false

Expand Down Expand Up @@ -187,7 +184,6 @@ jobs:
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: OSX ${{ matrix.os }}, molecule test scenario '${SCENARIO}' failed!"
env:
SCENARIO: ${{ matrix.scenario}}

security_test:

runs-on: ubuntu-latest
Expand Down

0 comments on commit 1937a76

Please sign in to comment.