Skip to content

Commit

Permalink
Push information to ouput file (#296)
Browse files Browse the repository at this point in the history
* Push information to ouput file
  • Loading branch information
rajbos authored Apr 28, 2023
1 parent 398aade commit 37cc8f7
Show file tree
Hide file tree
Showing 5 changed files with 10,753 additions and 4,062 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,17 @@ jobs:
core.error('Too many runners with label "self-hosted" found')
return
}
- name: Test if result files are not empty
run: |
runnersFile=${{ steps.load-runner-info-org.outputs.runners-file-location }}
if [ ! -s $runnersFile ]; then
echo "File [$runnersFile] is empty"
exit 1
fi
groupedFile=${{ steps.load-runner-info-org.outputs.grouped-file-location }}
if [ ! -s $groupedFile ]; then
echo "File [$groupedFile] is empty"
exit 1
fi
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ To run this action at the **repository** level, the access token must have scope
|`runners`|string|A JSON string with the runner information available|
|`grouped`|string|A JSON string with the number of runner grouped by their labels, also indicating their status|

When there are so many runners the JSON gets to large to use, use the filebased outputs instead:
|Name|Type|Description|
|---|---|---|
|`runners-file-location`|string|The path to the file with the runner information available|
|`grouped-file-location`|string|The path to the file with the number of runners grouped by their labels, also indicating their status|

Runners output example:
``` json
{
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ outputs:
description: 'JSON string with the runner information available in the organization or repo'
grouped:
description: 'JSON string with the labels and the number of runners with that label'
runners-file-location:
description: 'Path to the file that holds the JSON output'
grouped-file-location:
description: 'Path to the file that holds the JSON output'
runs:
using: 'node12'
using: 'node16'
main: 'dist/main.js'
Loading

0 comments on commit 37cc8f7

Please sign in to comment.