generated from mchmarny/template-action
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.31 KB
/
meter.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: meter
on:
workflow_call:
inputs:
metric:
description: 'Metric name'
required: true
type: string
value:
description: 'Metric value'
required: true
type: number
outputs:
metric:
value: ${{ jobs.meter.outputs.metric }}
value:
value: ${{ jobs.meter.outputs.value }}
permissions:
contents: read
env:
PROJECT_ID: cloudy-tools
IDENTITY_PROVIDER: projects/382826505963/locations/global/workloadIdentityPools/metrics-github-pool/providers/github-provider
SERVICE_ACCOUNT: metrics-github-actions-user@cloudy-tools.iam.gserviceaccount.com
jobs:
meter:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
outputs:
metric: ${{ steps.record.outputs.metric }}
value: ${{ steps.record.outputs.value }}
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
- uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d # v1.0.0
with:
workload_identity_provider: ${{ env.IDENTITY_PROVIDER }}
service_account: ${{ env.SERVICE_ACCOUNT }}
- id: record
uses: mchmarny/gcp-metrics@main
with:
project: ${{ env.PROJECT_ID }}
metric: ${{ inputs.metric }}
value: ${{ inputs.value }}