Give credit where credit is due! The Kudos for Code GitHub Action, crafted by LoremLabs, is your ally in appreciating the contributions of open-source collaborators. This automation streamlines the process of acknowledging Kudos within your codebase.
You can automatically install this in your repo via the Semicolons GitHub App, available after logging into semicolons.com.
To manually install this action, add the following to your workflow file .github/workflows/kudos.yml
:
name: Kudos for Code
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
kudos:
name: Supporting Your Open Source Teams
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: LoremLabs/kudos-for-code-action@latest
with:
search-dir: "."
destination: "artifact"
generate-nomerges: true
generate-validemails: true
generate-limitdepth: 1
generate-fromrepo: true
analyze-repo: false
search-dir
- Locate your source code directory. Defaults to.
analyze-repo
- Do deeper analysis of repo to look at included libraries. Defaults totrue
generate-fromrepo
- Include commits from top level repo if true. Defaults tofalse
destination
- Decide how kudos are allocated. Defaults topool
, also supportsartifact
.pool-id
- Identify the pool for kudos allocation (required fordestination: pool
).setler-keys
- Utilize Setler keys for transaction signing (required fordestination: pool
).pool-storage-token
- Employ the storage token fordestination: pool
(write permission required).pool-endpoint
- Utilize the Pool server for Kudos storage. Defaults tohttps://api.semicolons.com
.generate-nomerges
- Exclude merge commits when generating Kudos from the repository. Defaults totrue
.generate-validemails
- Include only valid email addresses during Kudos generation from the repository. Defaults totrue
.generate-limitdepth
- Set the depth limit for dependency inclusion during Kudos generation from the repository. Defaults to2
.skip-ids
- A space delimited list of ids to skip. Defaults to""
.
If your repo is a monorepo or includes multiple packages that should be analyzed independently, the following can be used as a starting point. Note that it assumes that your sub-repos are contained in a packages
directory.
name: Kudos for Code
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
get-packages:
name: Get Monorepo Packages
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-dirs.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set packages
id: set-dirs
run: |
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
packages=$(echo "${changed_files}" | grep '^packages/' | cut -d'/' -f2-3 | sort -u)
# Convert packages to a matrix format
matrix=$(echo "${packages}" | jq -R -s -c 'split("\n")[:-1]')
echo "::set-output name=matrix::${matrix}"
kudos:
needs: get-packages
name: Semicolons Kudos
permissions: write-all
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
directory: ${{fromJson(needs.get-packages.outputs.matrix)}}
steps:
- uses: actions/checkout@v2
- uses: LoremLabs/kudos-for-code-action@latest
with:
search-dir: ${{ matrix.directory }}
destination: "artifact"
generate-nomerges: true
generate-validemails: true
generate-limitdepth: 1
generate-fromrepo: true
analyze-repo: false
skip-ids: ""
Contact via semicolons.com.