mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
* pr_labeler: improve create_boilerplate_comment logging (cherry picked from commit5730ba9a01) * pr_labeler: add --force-process-closed flag (cherry picked from commit44ffe0f210) * pr_labeler: add warning for porting_guides changes This adds a warning message when PRs are created that edit porting_guides by someone outside of the Release Management WG. These files are automatically generated during the ansible release process and should not be modified. Fixes: https://github.com/ansible/ansible-documentation/issues/503 (cherry picked from commitd2e6625e8b) * pr_labeler: use @release-management-wg team for porting_guide check Instead of hardcoding the list of release managers, we can use the Github API to retrieve the members of the `@ansible/release-management-wg` team. (cherry picked from commitdddfd7eb55) * pr_labeler: exempt bots from porting_guide check For example, patchback is not a release manager, but we still want it to backport Porting Guide PRs. (cherry picked from commit746662c255) * pr_labeler: improve porting_guide_changes template wording Co-authored-by: Sandra McCann <samccann@redhat.com> (cherry picked from commit95ece7e9d6) * pr_labeler: refactor new_contributor_welcome code (#990) * pr_labeler: add GlobalArgs.full_repo property * pr_labeler: refactor new_contributor_welcome code As of https://github.com/ansible/ansible-documentation/issues/69, the pr_labeler responds with a welcome message when an issue or PR is opened by a new contributor. It turns out this never actually worked properly. The previous method that relied on Github's `author_association` flag did not work with the app token that the pr_labeler uses. This refactors the code to figure out whether a user is a new contributor by searching the list of issues and PRs. Fixes: https://github.com/ansible/ansible-documentation/issues/204 * pr_labeler: address potential race condition (cherry picked from commit763815d1ad) * Bump actions/setup-python from 4 to 5 (#966) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... (cherry picked from commit466b1fdc43) * pr_labeler: re-architect triager script (#1882) This commit reorganizes the issue/PR triager script and updates the workflow to run more efficiently. - Make the script a proper Python package instead of an unwieldy single file - Use locked dependencies and UV to decrease workflow runtime to under 10 seconds. (cherry picked from commit7138e42716) (cherry picked from commit1cf9f7917b) --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
---
|
|
# Copyright (C) 2023 Maxwell G <maxwell@gtmx.me>
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
"on":
|
|
pull_request_target:
|
|
issues:
|
|
types:
|
|
- opened
|
|
workflow_dispatch:
|
|
inputs:
|
|
type:
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- issue
|
|
- pr
|
|
number:
|
|
required: true
|
|
type: number
|
|
|
|
name: "Triage Issues and PRs"
|
|
|
|
jobs:
|
|
label_prs:
|
|
runs-on: ubuntu-latest
|
|
environment: github-bot
|
|
name: "Label Issue/PR"
|
|
steps:
|
|
- name: Print event information
|
|
env:
|
|
event_json: "${{ toJSON(github.event) }}"
|
|
run: |
|
|
echo "${event_json}"
|
|
- name: Generate temp GITHUB_TOKEN
|
|
id: create_token
|
|
uses: tibdex/github-app-token@v2
|
|
with:
|
|
app_id: ${{ secrets.BOT_APP_ID }}
|
|
private_key: ${{ secrets.BOT_APP_KEY }}
|
|
- name: Checkout parent repository
|
|
uses: actions/checkout@v4
|
|
- name: Install Python 3.11
|
|
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: |
|
|
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/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/ad-triage pr "${number}"
|