Skip to content

chore: Reactivate update-contributors workflow #4344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Update Contributors in README

on:
schedule:
- cron: '0 0 1-7 * SUN'
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
update-contributors:
if: github.repository == 'grafana/pyroscope'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760
with:
repo_secrets: |
GITHUB_APP_ID=pyroscope-development-app:app-id
GITHUB_APP_INSTALLATION_ID=pyroscope-development-app:app-installation-id
GITHUB_APP_PRIVATE_KEY=pyroscope-development-app:private-key

- name: Generate token
id: generate_token
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
with:
app-id: ${{ env.GITHUB_APP_ID }}
private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
pyroscope
- name: Get GitHub App User ID
id: get-user-id
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]"
echo "user-id=$(gh api "/users/${APP_BOT}" --jq .id)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v5
with:
go-version: 1.23.11
- name: Update contributors
run: make update-contributors

- name: Commit and push changes
run: |
APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]"
git config --local user.name "${APP_BOT}"
git config --local user.email "${{ steps.get-user-id.outputs.user-id }}+${APP_BOT}@users.noreply.github.com"
if ! git diff --exit-code README.md; then
git add README.md
git commit -m 'docs: updates the list of contributors in README'
gh auth status
git push --force https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}.git HEAD:main 2> /dev/null
fi
32 changes: 0 additions & 32 deletions .github/workflows_disabled/update-contributors.yml

This file was deleted.

Loading