-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
43 lines (43 loc) · 1.43 KB
/
action.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
name: Carbon Guard
description: Prevent pipelines running at times of high carbon intensity
inputs:
max_carbon_intensity:
description: The max intensity in gCO2/kWh
required: true
default: 'true'
data_source:
description: Data source for carbon intensity api
required: false
default: national-grid-eso-carbon-intensity
from_file_carbon_intensity_file_path:
description: A file to read the carbon intensity value from
required: false
co2_signal_api_key:
description: CO2 Signal API provided key
required: false
co2_signal_country_code:
description: Country Code for area of interest for CO2 Signal Api
required: false
runs:
using: "composite"
steps:
- name: Set up python 3.11
id: setup-python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: 3.11
- name: Install dependencies
working-directory: ${{ github.action_path }}
shell: bash
run: pip install -e .
- run: carbon_guard check
shell: bash
env:
MAX_CARBON_INTENSITY: ${{ inputs.max_carbon_intensity }}
DATA_SOURCE: ${{ inputs.data_source }}
FROM_FILE_CARBON_INTENSITY_FILE_PATH: ${{ inputs.from_file_carbon_intensity_file_path }}
CO2_SIGNAL_API_KEY: ${{ inputs.co2_signal_api_key }}
CO2_SIGNAL_COUNTRY_CODE: ${{ inputs.co2_signal_country_code }}
branding:
icon: cloud-lightning
color: green