Snippets Collections
name: Generate CHANGELOG.md
on:
  repository_dispatch:
  workflow_dispatch:
  push:
    branches:
      - main
      - master
jobs:
  changelog:
    name: Generate changelog
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Generate a changelog
        uses: orhun/git-cliff-action@v1
        id: git-cliff
        with:
          config: ./cliff.toml
          args: --verbose
        env:
          OUTPUT: ./CHANGELOG.md

      - name: Print the changelog
        run: cat "${{ steps.git-cliff.outputs.changelog }}"

      - name: Commit and Push Changes
        uses: actions-js/push@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
gh_labels:
  bug:
    description: Bugfixes in codebase when something is not working.
    colour: 'd73a4a'
  feature:
    description: New enhancements and features.
    colour: '1B6659'
  documentation:
    description: Improvements or additions to docs.
    colour: '0075ca'
  release:
    description: Indicates a new release.
    colour: '108a51'
  config:
    description: Configuration and meta-infrastructural changes.
    colour: '8ed92e'
  refactor:
    description: Code refactoring.
    colour: 'D0EFCD'
  question:
    description: Further information requested.
    colour: 'd876e3'
  data:
    description: Issues pertaining to data or data preparations.
    colour: 'FAA631'
  tests:
    description: Issues related to tests.
    colour: 'e4e669'
# configuration file for git-cliff

[changelog]
header = """
# Changelog
*All notable changes to this project will be documented in this file.*\n
"""
body = """
{% if version %}\
    ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
    ## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | upper_first }}
    {% for commit in commits %}
        - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
    {% endfor %}
{% endfor %}\n
"""
trim = true
footer = """
***
*Changelog generated by [git-cliff](https://github.com/orhun/git-cliff).*
"""
[git]
conventional_commits = true
filter_unconventional = true
commit_parsers = [
    { message = "^feat", group = "Features"},
    { message = "^fix", group = "Bug Fixes"},
    { message = "^bug", group = "Bug Fixes"},
    { message = "^doc", group = "Documentation"},
    { message = "^perf", group = "Performance"},
    { message = "^app", group = "Shiny App"},
    { message = "^api", group = "API"},
    { message = "^data", group = "Data"},
    { message = "^db", group = "Database"},
    { message = "^refactor", group = "Refactor"},
    { message = "^style", group = "Styling"},
    { message = "^test", group = "Testing"},
    { message = "^chore\\(release\\): prepare for", skip = true},
    { message = "^chore", group = "Miscellaneous Tasks"},
    { body = ".*security", group = "Security"},
]
filter_commits = false
tag_pattern = "v[0-9]*"
skip_tags = "v0.1.0-beta.1"
ignore_tags = ""
topo_order = false
sort_commits = "oldest"
/// Groups the elements in a collection using a block.
///
/// @param collection An object that implements @c NSFastEnumeration.
/// @param block      A block that takes an element in @c collection as its only
///                   argument and returns a key by which to group the element.
///                   The return value is required to implement @c NSCopying.
///                   The block must not be @c nil .
///
/// @returns A dictionary that maps the keys returned by @c block to a set of all
///          values in @c collection that share the same key.
///
/// Examples:
/// @code
/// NSArray *numbers = @[ @1, @2, @3, @4, @5 ];
///
/// NSDictionary *grouped = ASTGroupBy(numbers, ^(NSNumber *number){
///     return number.integerValue % 2 == 0 ? @"even" : @"odd";
/// });
///
/// grouped[@"even"]; /// { @2, @4 }
/// grouped[@"odd"];  /// { @1, @3, @5 }
/// @endcode
ASTERISM_OVERLOADABLE NSDictionary *ASTGroupBy(id<NSFastEnumeration> collection, id<NSCopying> (NS_NOESCAPE ^block)(id obj)) {
    return __ASTGroupBy_NSFastEnumeration_block(collection, block);
}

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension