Skip to content

Conversation

@Demolus13
Copy link
Member

Summary

Description of changes

Related issues

Checklist

  • I have reviewed the contribution guide.
  • My PR title and commits follow the Conventional Commits convention.
  • My commits include the "Signed-off-by" line.
  • I have signed my commits following the instructions provided by GitHub. Note that we run GitHub's commit verification tool to check the commit signatures. A green verified label should appear next to all of your commits on GitHub.
  • I have updated the relevant documentation, if applicable.
  • I have tested my changes and verified they work as expected.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 4, 2025
@Demolus13 Demolus13 self-assigned this Dec 4, 2025
README.md Outdated

To use the macaron action you can reference it in your workflow.
```yaml
- uses: oracle/macaron@v1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- uses: oracle/macaron@v1
- uses: oracle/macaron@v0.21.0

```yaml
- uses: oracle/macaron@v1
with:
repo_path: 'https://github.com/example/project'
Copy link
Member

Choose a reason for hiding this comment

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

Let's use an existing policy for this example, and also enable attestation.

README.md Outdated

**Macaron** is a software supply chain security analysis tool from Oracle Labs focused on verifying the **build integrity** of artifacts and their dependencies. It helps developers, security teams, and researchers ensure that packages are built as expected and have not been tampered with.

## Quick Action Usage
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## Quick Action Usage
Use Macaron as a GitHub Action

README.md Outdated

## Quick Action Usage

To use the macaron action you can reference it in your workflow.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
To use the macaron action you can reference it in your workflow.
To use the Macaron GitHub Action, add the following step to your workflow:

repo_path: 'https://github.com/example/project'
output_dir: 'macaron-output'
```
Copy link
Member

Choose a reason for hiding this comment

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

Add a sentence after the example like:

For detailed instructions and a comprehensive list of available options, please refer to the Macaron GitHub Action documentation .

README.md Outdated
![Macaron](./docs/source/assets/macaron.svg)

[Full Documentation](https://oracle.github.io/macaron/index.html) | [Tutorials](https://oracle.github.io/macaron/pages/tutorials/index.html) | [Videos](https://www.youtube.com/watch?v=ebo0kGKP6bw) | [Papers](#publications) | [Presentations](#presentations)
[Full Documentation](https://oracle.github.io/macaron/index.html) | [Tutorials](https://oracle.github.io/macaron/pages/tutorials/index.html) | [Videos](https://www.youtube.com/watch?v=ebo0kGKP6bw) | [Papers](#publications) | [Presentations](#presentations) | [Action](https://oracle.github.io/macaron/pages/macaron_action.html)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[Full Documentation](https://oracle.github.io/macaron/index.html) | [Tutorials](https://oracle.github.io/macaron/pages/tutorials/index.html) | [Videos](https://www.youtube.com/watch?v=ebo0kGKP6bw) | [Papers](#publications) | [Presentations](#presentations) | [Action](https://oracle.github.io/macaron/pages/macaron_action.html)
[Full Documentation](https://oracle.github.io/macaron/index.html) | [Tutorials](https://oracle.github.io/macaron/pages/tutorials/index.html) | [Videos](https://www.youtube.com/watch?v=ebo0kGKP6bw) | [Papers](#publications) | [Presentations](#presentations) | [Macaron GitHub Action](https://oracle.github.io/macaron/pages/macaron_action.html)

exit 0
# Get the run_macaron.sh script
if [ ! -f "run_macaron.sh" ]; then
curl -fSLO https://raw.githubusercontent.com/oracle/macaron/release/scripts/release_scripts/run_macaron.sh
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be downloaded from the release tag, otherwise it will always be latest and downloaded from the default branch, even if the users call the action with a specific tag.

echo "MACARON=$VENV_MACARON" >> "$GITHUB_ENV"
echo "$MACARON_DIR/.venv/bin" >> "$GITHUB_PATH"
chmod +x run_macaron.sh
echo "MACARON=$MACARON_DIR/run_macaron.sh" >> "$GITHUB_ENV"
Copy link
Member

Choose a reason for hiding this comment

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

If you don't set the MACARON_IMAGE_TAG environment variable, this script will always run the latest, which is not what we want. We should check what tag the action is called for and this env variable.

github_token:
description: The GitHub personal access token is needed for to run the analysis.
default: ${{ github.token }}
image_tag:
Copy link
Member

Choose a reason for hiding this comment

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

The user already provides the tag or hash by calling oracle/macaron@<tag-or-hash>. We shouldn't again ask for the image tag.

To get the tag, you can try a script like this

#!/bin/bash

ref="$GITHUB_REF"

# Default value for TAG.
TAG=""

if [[ "$ref" == refs/tags/* ]]; then
    TAG="${ref#refs/tags/}"
    echo "Ref is a tag: $TAG"
else
    sha="$GITHUB_SHA"
    if [[ -z "$sha" ]]; then
        sha="$ref"
    fi

    # Check for tags pointing directly at the SHA.
    tags=$(git tag --points-at "$sha")
    if [[ -n "$tags" ]]; then
        # Get the first tag (main or first one listed)
        TAG="$(echo "$tags" | head -n1)"
        echo "Commit $sha matches tag: $TAG"
    else
        # Search all tags that contain the commit (could be ancestor).
        history_tags=$(git tag --contains "$sha")
        if [[ -n "$history_tags" ]]; then
            TAG="$(echo "$history_tags" | head -n1)"
            echo "Commit $sha is contained by tag: $TAG"
        else
            echo "No tags found for commit $sha"
        fi
    fi
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants