ci(workflows): [ci
] add changelog
job
#6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Playground | |
# | |
# Debug git command output. | |
# | |
# References: | |
# | |
# - https://docs.github.com/actions/learn-github-actions/contexts | |
# - https://docs.github.com/actions/learn-github-actions/expressions | |
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
# - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions | |
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | |
# - https://github.com/actions/checkout | |
# - https://github.com/crazy-max/ghaction-import-gpg | |
--- | |
name: git | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/git.yml | |
workflow_dispatch: | |
inputs: | |
commits_from: | |
description: beginning of commit revision range | |
required: false | |
default: '' | |
type: string | |
commits_to: | |
description: end of commit revision range | |
required: false | |
default: HEAD | |
type: string | |
permissions: | |
contents: read | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
preflight: | |
runs-on: ubuntu-latest | |
outputs: | |
tag-prefix: ${{ steps.tag-prefix.outputs.result }} | |
version: ${{ steps.version.outputs.result }} | |
steps: | |
- id: debug | |
name: Print environment variables and event payload | |
uses: hmarr/debug-action@v2.1.0 | |
- id: checkout | |
name: Checkout ${{ github.ref_name }} | |
uses: actions/checkout@v4.1.1 | |
with: | |
persist-credentials: false | |
ref: ${{ github.ref }} | |
- id: version | |
name: Get semantic version | |
run: echo "result=$(jq .version package.json -r)" >>$GITHUB_OUTPUT | |
- id: tag-prefix | |
name: Get release tag prefix | |
run: echo "result=$(jq .tagprefix grease.config.json -r)" >>$GITHUB_OUTPUT | |
- id: gpg-import | |
name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6.0.0 | |
with: | |
git_commit_gpgsign: true | |
git_config_global: true | |
git_push_gpgsign: false | |
git_tag_gpgsign: true | |
git_user_signingkey: true | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
trust_level: 5 | |
- id: gitconfig | |
name: List gitconfig values | |
run: git config --list | |
commits: | |
needs: preflight | |
runs-on: ubuntu-latest | |
steps: | |
- id: checkout | |
name: Checkout ${{ github.ref_name }} | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- id: list | |
name: List commit logs | |
run: | | |
git log --decorate-refs=refs/tags --decorate=short --format='-author.email-%n%ae%n-author.name-%n%an%n-body-%n%b%n-date-%n%cI%n-hash-%n%h%n-header-%n%s%n-sha-%n%H%n-tags-%n%D%n-trailers-%n%(trailers)%n--$--' ${{ inputs.commits_from != '' && format('{0}..{1}', inputs.commits_from, inputs.commits_to) || inputs.commits_to }} | |
tags: | |
needs: preflight | |
runs-on: ubuntu-latest | |
steps: | |
- id: checkout | |
name: Checkout ${{ github.ref_name }} | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- id: list | |
name: List tags in reverse chronological order | |
run: git tag --list '${{ needs.preflight.outputs.tag-prefix }}*' --sort -creatordate |