Skip to content

docs: clarify new() docstrings of Alarm, Availability, Available and Todo #313

docs: clarify new() docstrings of Alarm, Availability, Available and Todo

docs: clarify new() docstrings of Alarm, Availability, Available and Todo #313

# Run gh-profiler against the author of each new issue and PR.
# See https://github.com/ehmatthes/gh-profiler
name: Profile contributors
on:
issues:
types: [opened]
# zizmor: ignore[dangerous-triggers] - pull_request_target needed to comment on PRs from forks
pull_request_target:
types: [opened]
permissions:
contents: read
issues: write
pull-requests: write
env:
# Exclude people from being profiled.
# See https://stackoverflow.com/a/73274812
VERIFIED_CONTRIBUTORS: ("angatha" "dependabot" "ennamarie19" "niccokunzmann" "peskypotato" "SashankBhamidi" "stevepiercy")
jobs:
profile-author:
runs-on: ubuntu-latest
steps:
- uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
- name: Install gh-profiler
run: uv tool install gh-profiler==0.8.3
- name: Determine target login and issue number
id: meta
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "issues" ]; then
echo "login=${{ github.event.issue.user.login }}" >> "$GITHUB_OUTPUT"
echo "number=${{ github.event.issue.number }}" >> "$GITHUB_OUTPUT"
else
echo "login=${{ github.event.pull_request.user.login }}" >> "$GITHUB_OUTPUT"
echo "number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
fi
- name: Run gh-profiler
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !contains(env.VERIFIED_CONTRIBUTORS, steps.meta.outputs.login) }}
run: |
set -euo pipefail
gh-profiler "${{ steps.meta.outputs.login }}" --concise > concise.txt
gh-profiler "${{ steps.meta.outputs.login }}" > full.txt
- name: Comment on issue or PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !contains(env.VERIFIED_CONTRIBUTORS, steps.meta.outputs.login) }}
run: |
set -euo pipefail
{
echo "Profile summary:"
echo
echo '```text'
cat concise.txt
echo '```'
echo
echo '<details>'
echo '<summary>Full profile</summary>'
echo
echo '```text'
cat full.txt
echo '```'
echo
echo '</details>'
} > body.txt
jq -Rs '{body: .}' body.txt > payload.json
gh api \
repos/${{ github.repository }}/issues/${{ steps.meta.outputs.number }}/comments \
--input payload.json