mirror of
https://github.com/dragonish/obsidian-heading-decorator.git
synced 2026-07-22 05:42:05 +00:00
ci(contributors): use the login name of GitHub
This commit is contained in:
parent
7edb5a78ad
commit
b678ded311
1 changed files with 14 additions and 4 deletions
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
|
|
@ -3,7 +3,7 @@ name: Release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- "*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -22,7 +22,7 @@ jobs:
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
cache: "pnpm"
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
|
|
@ -42,11 +42,21 @@ jobs:
|
||||||
id: contributors
|
id: contributors
|
||||||
run: |
|
run: |
|
||||||
previous_tag=$(git describe --abbrev=0 --tags HEAD^ 2>/dev/null || echo "")
|
previous_tag=$(git describe --abbrev=0 --tags HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$previous_tag" ]; then
|
if [ -z "$previous_tag" ]; then
|
||||||
contributors=$(git log --format='%an' HEAD | sort | uniq -c | sort -rn | head -10 | awk '{print "- @" $2}')
|
commits=$(git log --format='%H' HEAD)
|
||||||
else
|
else
|
||||||
contributors=$(git log ${previous_tag}..HEAD --format='%an' | sort | uniq -c | sort -rn | head -10 | awk '{print "- @" $2}')
|
commits=$(git log ${previous_tag}..HEAD --format='%H')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for sha in $commits; do
|
||||||
|
author=$(gh api repos/${{ github.repository }}/commits/$sha --jq '.author.login' 2>/dev/null)
|
||||||
|
if [ -n "$author" ]; then
|
||||||
|
echo "$author"
|
||||||
|
fi
|
||||||
|
done | sort | uniq -c | sort -rn | head -10 | awk '{print "- @" $2}' > contributors.txt
|
||||||
|
|
||||||
|
contributors=$(cat contributors.txt)
|
||||||
echo "contributors<<EOF" >> $GITHUB_OUTPUT
|
echo "contributors<<EOF" >> $GITHUB_OUTPUT
|
||||||
echo "$contributors" >> $GITHUB_OUTPUT
|
echo "$contributors" >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue