-
Notifications
You must be signed in to change notification settings - Fork 19
59 lines (50 loc) · 1.77 KB
/
get-action-usages.yml
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
52
53
54
55
56
57
58
59
on:
push:
branches:
- used-actions
workflow_dispatch:
# not available in GHES 3.1
#permissions: read-all
env:
container_registry: ghcr.io/rajbos/actions-marketplace
jobs:
get-action-usages:
runs-on: ubuntu-latest
container: ghcr.io/rajbos/actions-marketplace/powershell:7 # ${{ env.container_registry }} doesn't work :-
steps:
- uses: actions/checkout@v4
- name: Test PowerShell Modules forder in root folder
if: always()
run: |
cd /root/.local/share/powershell/Modules
ls -l
cd powershell-yaml
ls -l
- name: Test PowerShell Modules forder in usr folder
if: always()
run: |
cd /usr/local/share/powershell/
ls -la
- name: Test PowerShell Modules forder in opt folder
if: always()
run: |
cd /opt/microsoft/powershell/7/Modules/
ls -l
- shell: pwsh
if: always()
name: Get actions used in org data
run: |
$actions = (.\src\load-used-actions.ps1 -orgName ${{ github.repository_owner }} -PAT ${{ secrets.PAT }} -marketplaceRepo ${{ github.repository }} -userName "x" -userEmail "x" )
# wite the file outside of the container so we can pick it up
Write-Host "Found actions: "
Write-Host $actions | ConvertTo-Json -Depth 10
$jsonObject = ($actions | ConvertTo-Json -Depth 10)
$fileName = "summarized-actions.json"
New-Item -Path $fileName -Value $jsonObject -Force | Out-Null
$content = Get-Content $fileName
Write-Host "Written [$($content.Length)] characters to the output file [$fileName]"
- name: upload result file as artefact
uses: actions/upload-artifact@v4
with:
name: summarized-actions
path: summarized-actions.json