diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..781df79 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +ruby "3.2.2" + +gem 'octokit', '~> 7.1' +gem 'dogapi', '~> 1.45' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..1fa41a3 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,36 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.1.1) + dogapi (1.45.0) + multi_json + faraday (2.7.11) + base64 + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + multi_json (1.15.0) + octokit (7.1.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) + public_suffix (5.0.3) + ruby2_keywords (0.0.5) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + +PLATFORMS + x86_64-darwin-21 + x86_64-linux + +DEPENDENCIES + dogapi (~> 1.45) + octokit (~> 7.1) + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.3.17 diff --git a/README.md b/README.md index eb10d43..43486f8 100644 --- a/README.md +++ b/README.md @@ -135,10 +135,7 @@ jobs: name: Datadog reports if: ${{ always() }} steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.6 - - uses: scribd/github-action-datadog-reporting@v1 + - uses: scribd/github-action-datadog-reporting@v2 with: datadog-metric-prefix: 'github.action' metrics-type: 'job_metrics' @@ -169,10 +166,6 @@ jobs: 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 @@ -182,7 +175,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.OCTOKIT_TOKEN }} - id: datadog-metrics - uses: scribd/github-action-datadog-reporting@v1 + uses: scribd/github-action-datadog-reporting@v2 with: datadog-metric-prefix: 'github.action' metrics-type: 'velocity' diff --git a/action.yml b/action.yml index 1c0c499..817c3a0 100644 --- a/action.yml +++ b/action.yml @@ -28,11 +28,11 @@ inputs: runs: using: "composite" steps: - - name: Install required libraries for gems - shell: bash - run: | - gem install octokit -v 4.25.1 - gem install dogapi -v 1.45.0 + - uses: ruby/setup-ruby@v1 + with: + working-directory: ${{ github.action_path }} + bundler-cache: true + - name: Export extra data shell: bash run: | @@ -45,4 +45,5 @@ runs: - id: metric shell: bash run: | - ruby ${{ github.action_path }}/report_github_metrics.rb ${{github.repository}} ${{github.run_id}} ${{ inputs.datadog-metric-prefix }} '${{ inputs.teams }}' '${{ inputs.tagged-branches }}' '${{ inputs.custom-tags }}' ${{ inputs.api-url }} + cd ${{ github.action_path }} + bundle exec ruby report_github_metrics.rb ${{github.repository}} ${{github.run_id}} ${{ inputs.datadog-metric-prefix }} '${{ inputs.teams }}' '${{ inputs.tagged-branches }}' '${{ inputs.custom-tags }}' ${{ inputs.api-url }}