Skip to content

Move to projectbot for automatic labelling of issues and PRs #671

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 3 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 20 additions & 19 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: "Issue+PR Labeler"
name: "Issue+PR Labeler and Project Management"
on:
issues:
types: [opened]
types: [opened, edited, closed, reopened, labeled, unlabeled]
pull_request_target:
types: [opened]
types: [opened, edited, closed, reopened, labeled, unlabeled, ready_for_review, converted_to_draft]
project_card:
types: [created, moved, deleted]

permissions:
contents: read
issues: write
pull-requests: write
repository-projects: write

jobs:
triage:
Expand All @@ -24,14 +27,24 @@ jobs:
{
"members": "read",
"organization_projects": "write",
"issues": "read"
"issues": "write",
"pull_requests": "write",
"repository_projects": "write"
}

- name: Add to project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/elastic/projects/1511
github-token: ${{ steps.get_token.outputs.token }}

- name: Add aws-λ-extension label
uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ steps.get_token.outputs.token }}"
configuration-path: .github/labeler-config.yml
enable-versioned-regex: 0

- name: Check team membership for user
uses: elastic/get-user-teams-membership@5fa8d08135326e44d74d0ec4ef8705d8e36df12d # 1.1.0
id: checkUserMember
Expand All @@ -42,23 +55,11 @@ jobs:
apmmachine
dependabot
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Show team membership
run: |
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"

- name: Add community and triage labels
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ steps.get_token.outputs.token }}"
configuration-path: .github/community-label.yml
enable-versioned-regex: 0
- name: Assign new internal pull requests to project
uses: elastic/assign-one-project-github-action@2573c8fb01aadfde8f5b653eea21dd24569ca831 # 1.2.2
if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request
with:
project: 'https://github.com/orgs/elastic/projects/454'
project_id: '5882982'
column_name: 'In Progress'
env:
MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}