Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Release V2.1.0 #87

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c6b343d
migration
curlyreeve May 7, 2024
29a883e
updated
curlyreeve May 7, 2024
b3a3fc5
update
curlyreeve May 7, 2024
635a38f
docs: confluence document migration
curlyreeve May 17, 2024
73758b1
docs: confluence document migration
curlyreeve May 17, 2024
b33b455
Merge pull request #10 from frmscoe/Lextego_Migration
Sandy-at-Tazama May 17, 2024
87046ae
chore: add license header
cshezi May 23, 2024
768e112
Bump json5 from 1.0.1 to 1.0.2
dependabot[bot] May 23, 2024
70e5328
Bump decode-uri-component from 0.2.0 to 0.2.2
dependabot[bot] May 23, 2024
645b051
Bump minimist from 1.2.5 to 1.2.8
dependabot[bot] May 23, 2024
6e569da
Bump minimatch from 3.0.4 to 3.1.2
dependabot[bot] May 23, 2024
c1618ad
Bump semver-regex from 3.1.2 to 3.1.4
dependabot[bot] May 23, 2024
ab5120c
Bump http-cache-semantics from 4.1.0 to 4.1.1
dependabot[bot] May 23, 2024
0e2b042
Bump cookiejar from 2.1.2 to 2.1.4
dependabot[bot] May 23, 2024
7587bf8
Bump qs from 6.5.2 to 6.5.3
dependabot[bot] May 23, 2024
3983753
Merge pull request #9 from frmscoe/dependabot/npm_and_yarn/minimist-1…
scott45 May 26, 2024
0d1ff11
Merge pull request #7 from frmscoe/dependabot/npm_and_yarn/http-cache…
scott45 May 26, 2024
f92fc4e
Merge pull request #6 from frmscoe/dependabot/npm_and_yarn/qs-6.5.3
scott45 May 26, 2024
1cd9ea2
Merge pull request #5 from frmscoe/dependabot/npm_and_yarn/decode-uri…
scott45 May 26, 2024
c418364
Merge pull request #4 from frmscoe/dependabot/npm_and_yarn/minimatch-…
scott45 May 26, 2024
225570e
Merge pull request #3 from frmscoe/dependabot/npm_and_yarn/semver-reg…
scott45 May 26, 2024
0b7d95b
Merge pull request #2 from frmscoe/dependabot/npm_and_yarn/cookiejar-…
scott45 May 26, 2024
ea639d2
Bump axios from 0.21.1 to 0.28.0
dependabot[bot] May 26, 2024
716b55c
Bump word-wrap from 1.2.3 to 1.2.5
dependabot[bot] May 26, 2024
c24a181
Bump @babel/traverse from 7.14.0 to 7.24.6
dependabot[bot] May 26, 2024
c32db02
Merge pull request #17 from frmscoe/dependabot/npm_and_yarn/babel/tra…
scott45 May 27, 2024
8294e96
Merge pull request #13 from frmscoe/dependabot/npm_and_yarn/axios-0.28.0
scott45 May 27, 2024
5bfaef6
Bump ansi-regex from 4.1.0 to 4.1.1
dependabot[bot] May 27, 2024
192941a
Bump semver from 5.7.1 to 5.7.2
dependabot[bot] May 27, 2024
9d1276a
Merge pull request #16 from frmscoe/dependabot/npm_and_yarn/semver-5.7.2
scott45 May 27, 2024
e9da313
Merge pull request #14 from frmscoe/dependabot/npm_and_yarn/word-wrap…
scott45 May 27, 2024
8442f01
Bump log4js from 6.3.0 to 6.4.0
dependabot[bot] May 27, 2024
844258f
Merge pull request #12 from frmscoe/license-header
Justus-at-Tazama May 27, 2024
e791f94
Merge branch 'dev' into dependabot/npm_and_yarn/json5-1.0.2
Justus-at-Tazama May 27, 2024
feb2703
Merge pull request #19 from frmscoe/dependabot/npm_and_yarn/log4js-6.4.0
Justus-at-Tazama May 28, 2024
7a6dbba
Merge pull request #18 from frmscoe/dependabot/npm_and_yarn/ansi-rege…
Justus-at-Tazama May 28, 2024
2dbd9d4
Merge pull request #8 from frmscoe/dependabot/npm_and_yarn/json5-1.0.2
Justus-at-Tazama May 28, 2024
bcc39c5
Bump path-parse from 1.0.6 to 1.0.7 (#22)
dependabot[bot] May 28, 2024
2119994
Bump normalize-url from 4.5.0 to 4.5.1 (#21)
dependabot[bot] May 28, 2024
182c086
Bump tmpl from 1.0.4 to 1.0.5 (#20)
dependabot[bot] May 28, 2024
cc1aab8
Bump ws from 7.4.5 to 7.5.9 (#23)
dependabot[bot] May 28, 2024
47a742c
chore: linting and deps
Lenbkr Jun 7, 2024
110364e
chore: added eslint rule
Lenbkr Jun 10, 2024
beab2a5
chore: update tsconfig and remove junk
Lenbkr Jun 12, 2024
b798754
chore: lint and missing dep
Lenbkr Jun 12, 2024
19bfe2f
Merge pull request #26 from frmscoe/feat/eslint-deps-upgrades
Justus-at-Tazama Jun 14, 2024
40e7ca8
refactor: env.template point to v1 tms
cshezi Jun 19, 2024
d206aa3
Merge pull request #28 from frmscoe/rationalise-endpoints
Justus-at-Tazama Jun 20, 2024
5ba32dc
fix: updated the default values
cshezi Jun 21, 2024
ebece4d
Merge pull request #29 from frmscoe/rationalise-endpoints-v2
cshezi Jun 24, 2024
82e9e19
feat: fix data structure
JeanPierreNell Jun 28, 2024
0154c13
Merge pull request #31 from frmscoe/data-structure-fix
Lenbkr Jul 1, 2024
e5119b4
feat: Add more automation and refine workflows (#32)
scott45 Jul 3, 2024
ca10036
feat: Add workflows
vorsterk Jul 15, 2024
f42d084
Merge pull request #44 from frmscoe/release
vorsterk Jul 15, 2024
73ce12d
fix: Removed tests or dependencies because initial main doesnt have t…
vorsterk Jul 15, 2024
dc24164
Merge pull request #45 from frmscoe/rel
vorsterk Jul 15, 2024
cdd17d7
feat: refine and add new workflows (#46)
scott45 Jul 17, 2024
a8d724a
feat: Enhancement to the release workflow
vorsterk Jul 17, 2024
e6dc52e
Merge pull request #47 from frmscoe/release
vorsterk Jul 17, 2024
d7b860c
fix: remove failing scorecard (#49)
scott45 Jul 18, 2024
0694de2
chore(deps): bump path-to-regexp from 6.2.2 to 6.3.0
dependabot[bot] Sep 25, 2024
c18fb93
Merge pull request #73 from frmscoe/dependabot/npm_and_yarn/path-to-r…
Justus-at-Tazama Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Add workflows
vorsterk committed Jul 15, 2024
commit ca1003640d78d590cddf7656bd0964ad35ace760
63 changes: 63 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: Apache-2.0

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '17 0 * * 4'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
78 changes: 78 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SPDX-License-Identifier: Apache-2.0

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '34 0 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
22 changes: 22 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: Apache-2.0

# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
52 changes: 52 additions & 0 deletions .github/workflows/milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: Apache-2.0

name: Milestone Workflow

on:
workflow_dispatch:
inputs:
milestoneId:
description: 'Milestone ID'
required: true
default: '1'

jobs:
close_milestone:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Node.js (.npmrc)
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://npm.pkg.github.com/
# Defaults to the user or organization that owns the workflow file
scope: '@frmscoe'

- name: Install dependencies
run: npm ci
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Close Milestone
run: |
ACCESS_TOKEN="${{ secrets.GITHUB_TOKEN }}"
MILESTONE_NUMBER=${{ github.event.inputs.milestoneId }}
API_URL="https://api.github.com"
curl -X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{"state": "closed"}' \
$API_URL/repos/${{ github.repository }}/milestones/$MILESTONE_NUMBER
- name: Trigger Release Workflow
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
event-type: release
client-payload: '{"milestone_number": "${{ github.event.inputs.milestoneId }}"}'
44 changes: 44 additions & 0 deletions .github/workflows/njsscan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-License-Identifier: Apache-2.0

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow integrates njsscan with GitHub's Code Scanning feature
# nodejsscan is a static security code scanner that finds insecure code patterns in your Node.js applications

name: njsscan sarif

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '17 17 * * 1'

permissions:
contents: read

jobs:
njsscan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
name: njsscan code scanning
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@7237412fdd36af517e2745077cedbf9d6900d711
with:
args: '. --sarif --output results.sarif || true'
- name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
42 changes: 42 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: Apache-2.0

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
name: install, build, test
permissions:
packages: write
contents: read
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node.js (.npmrc)
uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: https://npm.pkg.github.com/
# Defaults to the user or organization that owns the workflow file
scope: '@frmscoe'
- name: Install dependencies
run: npm ci
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- name: Run unit tests
run: npm run test
env:
NODE_ENV: 'test'
STARTUP_TYPE: 'nats'
207 changes: 207 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# SPDX-License-Identifier: Apache-2.0

name: Release Workflow

on:
repository_dispatch:
types: [release]
properties:
milestone_number:
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0 # Fetch all tags

# Fetch merged pull request and determine release labels
- uses: actions-ecosystem/action-get-merged-pull-request@v1
id: get-merged-pull-request
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions-ecosystem/action-release-label@v1
id: release-label
if: ${{ steps.get-merged-pull-request.outputs.title != null }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
#labels: ${{ steps.get-merged-pull-request.outputs.labels }}

# Get the latest tag in the repositorys
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: ${{ steps.release-label.outputs.level != null }}
with:
semver_only: true

- name: Setup Node.js (.npmrc)
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: https://npm.pkg.github.com/
# Defaults to the user or organization that owns the workflow file
scope: '@frmscoe'

- name: Install dependencies
run: npm ci
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Run Tests
run: npm test
env:
STARTUP_TYPE: 'nats'

# Determine the release type (major, minor, patch) based on commit messages
- name: Determine Release Type
id: determine_release
run: |
export PREV_VERSION=$(git describe --abbrev=0 --tags)
echo "Previous Version: $PREV_VERSION"
export COMMIT_MESSAGES=$(git log $PREV_VERSION^..HEAD --format=%B)
echo "Commit Messages: $COMMIT_MESSAGES"
# Determine release type based on commit messages and labels
RELEASE_TYPE="patch" # Default to patch
if echo "$COMMIT_MESSAGES" | grep -q -e "BREAKING CHANGE:"; then
RELEASE_TYPE="major"
elif echo "$COMMIT_MESSAGES" | grep -q -e "feat:"; then
RELEASE_TYPE="minor"
elif echo "$COMMIT_MESSAGES" | grep -q -e "feat:" && (echo "$COMMIT_MESSAGES" | grep -q -e "fix:" || echo "$COMMIT_MESSAGES" | grep -q -e "enhancement:" || echo "$COMMIT_MESSAGES" | grep -q -e "docs:" || echo "$COMMIT_MESSAGES" | grep -q -e "refactor:" || echo "$COMMIT_MESSAGES" | grep -q -e "chore:"); then
RELEASE_TYPE="minor"
elif echo "$COMMIT_MESSAGES" | grep -q -e "fix:" -e "enhancement:" -e "docs:" -e "refactor:" -e "chore:"; then
RELEASE_TYPE="patch"
fi
echo "Release Type: $RELEASE_TYPE"
echo "::set-output name=release_type::$RELEASE_TYPE"
# Bump the version based on the determined release type
- name: Bump Version
id: bump_version
run: |
export PREV_VERSION=$(git describe --abbrev=0 --tags)
echo "Previous Version: $PREV_VERSION"
export RELEASE_TYPE=${{ steps.determine_release.outputs.release_type }}
echo "Release Type: $RELEASE_TYPE"
export VERSION_PARTS=($(echo $PREV_VERSION | tr '.' '\n'))
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
if [[ $RELEASE_TYPE == "major" ]]; then
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
elif [[ $RELEASE_TYPE == "minor" ]]; then
MINOR=$((MINOR + 1))
PATCH=0
else
PATCH=$((PATCH + 1))
fi
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "New Version: $NEW_VERSION"
echo "::set-output name=new_version::$NEW_VERSION"
# Get the milestone details
- name: Get Milestone Details
id: get_milestone
run: |
# Retrieve the milestone ID from the workflow input
MILESTONE_ID=${{ github.event.client_payload.milestone_number }}
MILESTONE_RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/milestones/${MILESTONE_ID}")
MILESTONE_TITLE=$(echo "$MILESTONE_RESPONSE" | jq -r '.title')
MILESTONE_DESCRIPTION=$(echo "$MILESTONE_RESPONSE" | jq -r '.description')
MILESTONE_DATE=$(echo "$MILESTONE_RESPONSE" | jq -r '.due_on')
echo "::set-output name=milestone_title::$MILESTONE_TITLE"
echo "::set-output name=milestone_description::$MILESTONE_DESCRIPTION"
echo "::set-output name=milestone_date::$MILESTONE_DATE"
# Generate the changelog based on commit messages and labels
- name: Generate Changelog
id: generate_changelog
run: |
# Generate Changelog Script
# Constants
CHANGELOG_FILE="/home/runner/work/changelog.txt"
LABEL_BUG="fix:"
LABEL_FEATURE="feat:"
LABEL_ENHANCEMENT="enhancement:"
LABEL_DOCS="docs:"
LABEL_REFACTOR="refactor:"
LABEL_CHORE="chore:"
LABEL_BREAKING_CHANGE="BREAKING CHANGE:"
# Get the last release tag
LAST_RELEASE_TAG=$(git describe --abbrev=0 --tags)
# Get the milestone details from the output of the previous step
MILESTONE_TITLE="${{ steps.get_milestone.outputs.milestone_title }}"
MILESTONE_DESCRIPTION="${{ steps.get_milestone.outputs.milestone_description }}"
MILESTONE_DATE="${{ steps.get_milestone.outputs.milestone_date }}"
# Append the milestone details to the changelog file
echo "## Milestone: $MILESTONE_TITLE" >> "$CHANGELOG_FILE"
echo "Date: $MILESTONE_DATE" >> "$CHANGELOG_FILE"
echo "Description: $MILESTONE_DESCRIPTION" >> "$CHANGELOG_FILE"
echo "" >> "$CHANGELOG_FILE"
# Function to append section to the changelog file
append_section() {
local section_title="$1"
local section_label="$2"
local section_icon="$3"
# Get the commit messages with the specified label between the last release and the current release
local commit_messages=$(git log --pretty=format:"- %s (Milestone: %b, Linked Issues: %C(yellow)%H%Creset)" "$LAST_RELEASE_TAG..HEAD" --grep="$section_label" --no-merges --decorate --decorate-refs=refs/issues)
# If there are commit messages, append the section to the changelog file
if [ -n "$commit_messages" ]; then
echo "### $section_icon $section_title" >> "$CHANGELOG_FILE"
echo "" >> "$CHANGELOG_FILE"
echo "$commit_messages" >> "$CHANGELOG_FILE"
echo "" >> "$CHANGELOG_FILE"
fi
}
# Append sections to the changelog file based on labels
append_section "Bug Fixes" "$LABEL_BUG" "🐞"
append_section "New Features" "$LABEL_FEATURE" "⭐️"
append_section "Enhancements" "$LABEL_ENHANCEMENT" "✨"
append_section "Documentation" "$LABEL_DOCS" "📚"
append_section "Refactorings" "$LABEL_REFACTOR" "🔨"
append_section "Chores" "$LABEL_CHORE" "⚙️"
append_section "Breaking Changes" "$LABEL_BREAKING_CHANGE" "💥"
echo "::set-output name=changelog_file::$CHANGELOG_FILE"
# Read changelog contents into a variable
- name: Read Changelog Contents
id: read_changelog
run: |
echo "::set-output name=changelog_contents::$(cat /home/runner/work/changelog.txt)"
# Display changelog
- name: Display Changelog
run: cat /home/runner/work/changelog.txt

# Attach changelog as an artifact
- name: Attach Changelog to Release
uses: actions/upload-artifact@v2
with:
name: Changelog
path: /home/runner/work/changelog.txt

# Create release while including the changelog
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump_version.outputs.new_version }}
release_name: ${{ steps.bump_version.outputs.new_version }}
body_path: /home/runner/work/changelog.txt
draft: false
prerelease: false