Skip to content

Conversation

@kranurag7
Copy link
Contributor

In really a good amount of cases in wolfi, the binary output matches
the package name.
this commit changes the defaults of help-check and ver-check inputs.

with this change, in a good amount of packages, we can use the pipeline
in following manner:

- uses: test/tw/ver-check
- uses: test/tw/help-check

the change is backwards compatible because we've pinned things everywhere
till now so existing pipeline usage is not affected by this change.

Signed-off-by: kranurag7 [email protected]

Co-authored-by: Dentrax [email protected]

In really a good amount of cases in wolfi, the binary output matches
the package name.
this commit changes the defaults of help-check and ver-check inputs.

with this change, in a good amount of packages, we can use the pipeline
in following manner:
```bash
- uses: test/tw/ver-check
- uses: test/tw/help-check
```

the change is backwards compatible because we've pinned things everywhere
till now so existing pipeline usage is not affected by this change.

Signed-off-by: kranurag7 <[email protected]>

Co-authored-by: Dentrax <[email protected]>
@kranurag7
Copy link
Contributor Author

to find cases where the binary output is same as package.name we can use the following:

Details

#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["pyyaml"]
# ///

import yaml
from pathlib import Path

def find_matching_packages():
    """Find melange configs where go/build output matches package.name"""
    matches = []

    # Find all YAML files in current directory
    for yaml_file in Path('.').glob('*.yaml'):
        try:
            with open(yaml_file, 'r') as f:
                config = yaml.safe_load(f)

            # Check if go/build output matches package name
            try:
                package_name = config['package']['name']
                for step in config['pipeline']:
                    if step['uses'] == 'go/build' and step['with']['output'] == package_name:
                        matches.append(yaml_file.name)
                        break
            except KeyError:
                # Skip files missing required structure
                pass

        except Exception as e:
            print(f"Error reading {yaml_file}: {e}")
            continue

    return matches

if __name__ == "__main__":
    matches = find_matching_packages()
    print(f"Found {len(matches)} packages where go/build output matches package.name:")
    for match in matches:
        print(f"  {match}")

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