Skip to content

Commit 685bba2

Browse files
authored
Merge pull request #16 from cloudyspells/feature/action-output
Feature/action percentage output
2 parents 12275d4 + 0534ef9 commit 685bba2

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/qa.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
- name: Echo region from action
9393
run: |
9494
echo 'Best emissions region: ${{ steps.watttime_action.outputs.region }}'
95+
echo 'Best emissions percent: ${{ steps.watttime_action.outputs.percent }}'
9596
9697
- name: Upload test results
9798
uses: actions/upload-artifact@v3

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ outputs:
2121
region:
2222
description: Azure region with the best emissions
2323
value: ${{ steps.invokewatttime.outputs.region}}
24+
percent:
25+
description: Percentage of energy with carbon emissions
26+
value: ${{ steps.invokewatttime.outputs.percent }}
2427
runs:
2528
using: composite
2629
steps:
@@ -39,3 +42,10 @@ runs:
3942
$token = Get-WattTimeAuthToken -Username ${{ inputs.watttime_username }} -Password ${{ inputs.watttime_password }}
4043
$result = Get-AzureRegionWithLowestWattTime -Regions ${{ inputs.regions }} -AuthToken $token
4144
"region=$($result.region)" >> $env:GITHUB_OUTPUT
45+
"percent=$($result.percent)" >> $env:GITHUB_OUTPUT
46+
Write-Output "### PSWattTime Azure Region selection" >> $env:GITHUB_STEP_SUMMARY
47+
Write-Output "" >> $env:GITHUB_STEP_SUMMARY
48+
Write-Output "- Azure region with lowest emissions: **$($result.region)**" >> $env:GITHUB_STEP_SUMMARY
49+
Write-Output "- Emissions percentage: **$($result.percent)**" >> $env:GITHUB_STEP_SUMMARY
50+
51+

src/PSWattTime/PSWattTime.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PSWattTime.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.3.0'
15+
ModuleVersion = '1.0.4.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

0 commit comments

Comments
 (0)