Skip to content

Commit

Permalink
Limited scan all to prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Oct 5, 2023
1 parent 976202d commit aaadd57
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/scan-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Scan all

on:
workflow_dispatch:
inputs:
prefix:
description: "Name prefix to include"
type: string
required: true

concurrency:
group: ${{ github.workflow }}
Expand All @@ -15,11 +20,6 @@ jobs:
tools_with_version: ${{ steps.collect.outputs.tools_with_version }}
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install uniget
uses: uniget-org/uniget-action@main
with:
Expand All @@ -28,14 +28,16 @@ jobs:

- name: Collect
id: collect
env:
prefix: ${{ inputs.prefix }}
run: |
TOOLS="$(
helper/usr/local/bin/regctl manifest get ghcr.io/uniget-org/tools/metadata:main --format raw-body \
| helper/usr/local/bin/jq --raw-output '.layers[0].digest' \
| xargs -I{} \
helper/usr/local/bin/regctl blob get ghcr.io/uniget-org/tools/metadata:main {} \
| tar --extract --gzip --to-stdout \
| helper/usr/local/bin/jq --raw-output '.tools[] | "\(.name):\(.version)"'
| helper/usr/local/bin/jq --raw-output --arg prefix "${prefix}" '.tools[] | select(.name | startswith($prefix)) | "\(.name):\(.version)"'
)"
echo "### Tools to process: ${TOOLS}."
Expand Down

0 comments on commit aaadd57

Please sign in to comment.