Skip to content

Conversation

@aborrero
Copy link
Contributor

@aborrero aborrero commented Dec 1, 2025

Add new pipeline to help us check that a given package contains some files.

@aborrero aborrero requested a review from debasishbsws December 1, 2025 17:10
@aborrero aborrero force-pushed the arturo-112-tw-add-pipelines-te branch from e3ea1e0 to 6f7a799 Compare December 1, 2025 17:16
@debasishbsws
Copy link
Member

I have a question, what if there are files more than one directory? do we have to have multiple contains-files test for that?

@aborrero
Copy link
Contributor Author

aborrero commented Dec 2, 2025

I have a question, what if there are files more than one directory? do we have to have multiple contains-files test for that?

yes, you can repeat the pipeline as much as you need.

@debasishbsws
Copy link
Member

@aborrero

Suggestion: Add files Parameter

As you said Currently, testing files across multiple directories requires multiple test blocks. Consider adding a files parameter for checking specific file paths:

inputs:
  files:
    description: |
      Exact file paths to check (space-separated).
      When provided, ignores dir/name/type and checks these specific files.
      Example: files: "/usr/bin/tool /usr/lib/lib.so /opt/app/binary"
    required: false

This would solve a common use case where we need to verify files across different directories:

# Instead of:
- uses: test/contains-files
  with:
    dir: /usr/bin/
    name: aws-eks-na-cli
- uses: test/contains-files
  with:
    dir: /usr/lib/
    name: libre2.so
- uses: test/contains-files
  with:
    dir: /opt/app/
    name: controller

# We could do:
- uses: test/contains-files
  with:
    files: "/usr/bin/aws-eks-na-cli /usr/lib/libre2.so /opt/app/controller"

For better readability with many files, you could support multi-line YAML:

- uses: test/contains-files
  with:
    files: |
      /usr/bin/aws-eks-na-cli
      /usr/lib/libre2.so
      /opt/app/controller
      /etc/config/app.conf

@aborrero aborrero force-pushed the arturo-112-tw-add-pipelines-te branch from 6f7a799 to 68f34e6 Compare December 2, 2025 11:35
@aborrero
Copy link
Contributor Author

aborrero commented Dec 2, 2025

Update that includes your suggestion.

@aborrero aborrero force-pushed the arturo-112-tw-add-pipelines-te branch from 68f34e6 to e7d0957 Compare December 2, 2025 11:41
Add new pipeline to help us check that a given package contains some files.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero@chainguard.dev>
@aborrero aborrero force-pushed the arturo-112-tw-add-pipelines-te branch from e7d0957 to b7ff2b7 Compare December 2, 2025 11:42
Copy link
Member

@debasishbsws debasishbsws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@aborrero aborrero merged commit fc8946a into main Dec 2, 2025
8 checks passed
@aborrero aborrero deleted the arturo-112-tw-add-pipelines-te branch December 2, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants