Skip to content

Commit c91dd98

Browse files
added github action automation (#148)
1 parent 51ccdec commit c91dd98

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.github/community-label.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# add 'community' label to all new issues and PRs created by the community
3+
community:
4+
- '.*'
5+
triage:
6+
- '.*'

.github/labeler-config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# add 'agent-java' label to all new issues
2+
agent-java:
3+
- '.*'

.github/workflows/addToProject.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: Auto Assign to Project(s)
3+
4+
on:
5+
issues:
6+
types: [opened, edited, milestoned]
7+
env:
8+
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
9+
10+
jobs:
11+
assign_one_project:
12+
runs-on: ubuntu-latest
13+
name: Assign milestoned to Project
14+
steps:
15+
- name: Assign issues with milestones to project
16+
uses: elastic/[email protected]
17+
if: github.event.issue && github.event.issue.milestone
18+
with:
19+
project: 'https://github.com/orgs/elastic/projects/454'
20+
project_id: '5882982'
21+
column_name: 'Planned'

.github/workflows/labeler.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Issue Labeler"
2+
on:
3+
issues:
4+
types: [opened]
5+
pull_request_target:
6+
types: [opened]
7+
env:
8+
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
9+
10+
jobs:
11+
triage:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Add agent-java label
15+
uses: AlexanderWert/[email protected]
16+
with:
17+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
18+
configuration-path: .github/labeler-config.yml
19+
enable-versioned-regex: 0
20+
- name: Check team membership for user
21+
uses: elastic/[email protected]
22+
id: checkUserMember
23+
with:
24+
username: ${{ github.actor }}
25+
team: 'apm'
26+
usernamesToExclude: |
27+
apmmachine
28+
dependabot
29+
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
30+
- name: Show team membership
31+
run: |
32+
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
33+
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"
34+
- name: Add community and triage lables
35+
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
36+
uses: AlexanderWert/[email protected]
37+
with:
38+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
39+
configuration-path: .github/community-label.yml
40+
enable-versioned-regex: 0
41+
- name: Assign new internal pull requests to project
42+
uses: elastic/[email protected]
43+
if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request
44+
with:
45+
project: 'https://github.com/orgs/elastic/projects/454'
46+
project_id: '5882982'
47+
column_name: 'In Progress'

0 commit comments

Comments
 (0)