Skip to content

Commit

Permalink
added github action automation (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWert authored Oct 11, 2021
1 parent 51ccdec commit c91dd98
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/community-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# add 'community' label to all new issues and PRs created by the community
community:
- '.*'
triage:
- '.*'
3 changes: 3 additions & 0 deletions .github/labeler-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# add 'agent-java' label to all new issues
agent-java:
- '.*'
21 changes: 21 additions & 0 deletions .github/workflows/addToProject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

name: Auto Assign to Project(s)

on:
issues:
types: [opened, edited, milestoned]
env:
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}

jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign milestoned to Project
steps:
- name: Assign issues with milestones to project
uses: elastic/assign-one-project-github-action@1.2.2
if: github.event.issue && github.event.issue.milestone
with:
project: 'https://github.com/orgs/elastic/projects/454'
project_id: '5882982'
column_name: 'Planned'
47 changes: 47 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Issue Labeler"
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
env:
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}

jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Add agent-java label
uses: AlexanderWert/issue-labeler@v2.3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-config.yml
enable-versioned-regex: 0
- name: Check team membership for user
uses: elastic/get-user-teams-membership@v1.0.4
id: checkUserMember
with:
username: ${{ github.actor }}
team: 'apm'
usernamesToExclude: |
apmmachine
dependabot
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_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 lables
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
uses: AlexanderWert/issue-labeler@v2.3
with:
repo-token: "${{ secrets.GITHUB_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@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'

0 comments on commit c91dd98

Please sign in to comment.