mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-28 03:20:58 +01:00
99dd426cba
Pull in the list of authors with high clean merge rates from Snowflake (clean merge rate means we are not counting a quick self-closed PR mistake as a rejected PR), store the list in the GitHub project board's readme (it's a hacky place, for simplicity), and show those authors as "High MR" (not just "Returning") on the board with the community PRs. Release Notes: - N/A
79 lines
2.7 KiB
YAML
79 lines
2.7 KiB
YAML
# Community PR Board — daily signal fields refresh
|
|
#
|
|
# Copies the High MR contributors from Snowflake into the board's README, then
|
|
# walks every open PR on the community board and recomputes its signal
|
|
# fields. Backstop for changes that don't reach the event-driven workflow,
|
|
# either because the relevant webhook isn't subscribed or doesn't fire at all.
|
|
|
|
name: Community PR Board Signals Refresh
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 9 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: community-pr-board-refresh
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
refresh:
|
|
if: github.repository == 'zed-industries/zed'
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Generate app token
|
|
id: app-token
|
|
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
|
|
with:
|
|
app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }}
|
|
private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }}
|
|
owner: zed-industries
|
|
repositories: zed
|
|
permission-issues: read
|
|
permission-members: read
|
|
permission-organization-projects: write
|
|
permission-pull-requests: read
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
with:
|
|
sparse-checkout: |
|
|
script/github-community-pr-board.py
|
|
script/github_helpers.py
|
|
script/snowflake_helpers.py
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
run: pip install requests cryptography==50.0.2
|
|
|
|
- name: Publish High MR contributors
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
PROJECT_NUMBER: "85"
|
|
PUBLISH_HIGH_MR: "1"
|
|
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
|
|
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_BOARD_USER }}
|
|
SNOWFLAKE_ROLE: ${{ secrets.SNOWFLAKE_BOARD_ROLE }}
|
|
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_BOARD_WAREHOUSE }}
|
|
SNOWFLAKE_PRIVATE_KEY: ${{ secrets.SNOWFLAKE_BOARD_PRIVATE_KEY }}
|
|
run: python script/github-community-pr-board.py
|
|
|
|
- name: Refresh all board items
|
|
# Also when publishing failed, with the High MR list already on the board.
|
|
if: ${{ !cancelled() }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
PROJECT_NUMBER: "85"
|
|
REFRESH_ALL: "1"
|
|
run: python script/github-community-pr-board.py
|