Skip to content
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

[stable-2.15] Backport pr_labeler changes #1917

Merged
merged 9 commits into from
Sep 20, 2024
Merged
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
13 changes: 8 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,29 @@ jobs:
- name: Checkout parent repository
uses: actions/checkout@v4
- name: Install Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Setup venv
run: |
python -m venv venv
./venv/bin/pip install -r hacking/pr_labeler/requirements.txt
uv venv venv
uv pip install --python venv \
-e hacking/pr_labeler -c tests/pr_labeler.txt
- name: "Run the issue labeler"
if: "github.event.issue || inputs.type == 'issue'"
env:
event_json: "${{ toJSON(github.event) }}"
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
number: "${{ github.event.issue.number || inputs.number }}"
run: |
./venv/bin/python hacking/pr_labeler/label.py issue "${number}"
./venv/bin/ad-triage issue "${number}"
- name: "Run the PR labeler"
if: "github.event.pull_request || inputs.type == 'pr'"
env:
event_json: "${{ toJSON(github.event) }}"
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
number: "${{ github.event.number || inputs.number }}"
run: |
./venv/bin/python hacking/pr_labeler/label.py pr "${number}"
./venv/bin/ad-triage pr "${number}"
1 change: 1 addition & 0 deletions hacking/pr_labeler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.egg-info/
310 changes: 0 additions & 310 deletions hacking/pr_labeler/label.py

This file was deleted.

Empty file.
13 changes: 13 additions & 0 deletions hacking/pr_labeler/pr_labeler/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2023 Maxwell G <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Module entrypoint
"""

from __future__ import annotations

from .cli import APP

if __name__ == "__main__":
APP()
Loading
Loading