Skip to content

Instantly share code, notes, and snippets.

# Considering that your app version is stored in VERSION.md file
#
# Example: ./gitlab-changelog.sh
# Example: ./gitlab-changelog.sh <YOUR-GITLAB-PROJECT-ACCESS-TOKEN>
#!/bin/bash
app_version=$(cat VERSION.md)
branch=dev
/**
* Gets the last version number of the project and generates remotely the changelog on the current branch
*
* Master branch:
* Only commits with 'Fix' git trailer will be involved in changelog entries
*
* Other branch:
* Only commits with 'Changelog' (default value) git trailer will be involved in changelog entries.
*
* Example: node ./gitlab-changelog.js
@AvocadoVenom
AvocadoVenom / gitlab-changelog.js
Created May 23, 2022 07:47
Generates remotely the changelog for the current branch
/* Gets the last version number of the project and generates remotely the changelog on the current branch */
const { exec } = require('child_process');
const axios = require('axios');
const version = require('../../package.json').version;
// Allow to access the environment variables
require('dotenv').config();
@AvocadoVenom
AvocadoVenom / gitlab-changelog.js
Last active July 7, 2022 00:20
Script to generate/update CHANGELOG.md using GitLab API
/**
* Gets the last version number of the project and generates remotely the changelog on the dev branch via GitLab API.
*
* Example: node ./gitlab-changelog.js
*/
const axios = require('axios');
const version = require('../../package.json').version;
const branch = 'dev';
@AvocadoVenom
AvocadoVenom / CHANGELOG.md
Created May 1, 2022 15:50
An example of release note
import styled from 'styled-components'
const CircleProgressBar = styled.div({
background: ({ progress }) => {
// Adapt the logic here
const angle = 360 * progress
return `radial-gradient(white 50%, transparent 51%),
conic-gradient(transparent 0deg ${angle}deg, gainsboro ${angle}deg 360deg),
conic-gradient(orange 0deg, yellow 90deg, lightgreen 180deg, green)`
<script>
import CircleProgressBar from './CircleProgressBar.svelte'
const progress = Math.random()
</script>
<CircleProgressBar progress={progress} />
<template></template>
<script lang="ts">
import { computed, defineComponent, toRefs } from 'vue';
export default defineComponent({
props: {
progress: { type: Number, required: true }
},
setup(props) {
@Component({
selector: 'circle-progress-bar',
template: ``,
styles: [`
.circle-container__progress { // For conic-gradient approach
stroke-dashoffset: var(--progress-stroke-dashoffset);
}
#progress-circle { // For SVG approach
background: var(--progress-background);
}
[type="checkbox"] {
accent-color: darkgreen;
}
[type="radio"] {
accent-color: midnightblue;
}
* {
accent-color: tomato;