Skip to content

Commit

Permalink
Add repo velocity reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mandilook committed Dec 15, 2021
1 parent 4247739 commit 159fb2d
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 159fb2d

Please sign in to comment.