Skip to content

Commit

Permalink
Merge pull request #228 from meroxa/add-velocity-metrics
Browse files Browse the repository at this point in the history
Add repo velocity reporting
  • Loading branch information
mandilook authored Dec 15, 2021
2 parents 4247739 + 159fb2d commit 29162d5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/velocity_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Velocity Workflow
on:
pull_request:
types: [opened, closed]
jobs:
metrics:
if: |
(github.event.action == 'closed' &&
github.event.pull_request.merged == true) ||
github.event.action == 'opened'
name: Track merge request activity
runs-on: ubuntu-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

# Optional step that allows tagging time to merge with a team
- uses: tspascoal/get-user-teams-membership@v1
id: actorTeams
if: ${{ !endsWith(github.event.pull_request.user.login, '[bot]') }}
with:
username: ${{ github.event.pull_request.user.login }}
GITHUB_TOKEN: ${{ secrets.MEROXA_MACHINE }}

- id: datadog-metrics
uses: scribd/github-action-datadog-reporting@v1
with:
datadog-metric-prefix: 'github_action_reporting.repo_velocity'
metrics-type: 'velocity'
teams: ${{ steps.actorTeams.outputs.teams }}
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
OCTOKIT_TOKEN: ${{ secrets.MEROXA_MACHINE }}

0 comments on commit 29162d5

Please sign in to comment.