-
Notifications
You must be signed in to change notification settings - Fork 30
docs: update documentation for macaron action #1259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Demolus13 <[email protected]>
Signed-off-by: Demolus13 <[email protected]>
Signed-off-by: Demolus13 <[email protected]>
README.md
Outdated
|
|
||
| To use the macaron action you can reference it in your workflow. | ||
| ```yaml | ||
| - uses: oracle/macaron@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - uses: oracle/macaron@v1 | |
| - uses: oracle/macaron@v0.21.0 |
| ```yaml | ||
| - uses: oracle/macaron@v1 | ||
| with: | ||
| repo_path: 'https://github.com/example/project' |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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' | ||
| ``` | ||
There was a problem hiding this comment.
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
|  | ||
|
|
||
| [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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [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) |
scripts/actions/setup_macaron.sh
Outdated
| 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 |
There was a problem hiding this comment.
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.
scripts/actions/setup_macaron.sh
Outdated
| 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" |
There was a problem hiding this comment.
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.
Signed-off-by: Demolus13 <[email protected]>
Signed-off-by: Demolus13 <[email protected]>
| github_token: | ||
| description: The GitHub personal access token is needed for to run the analysis. | ||
| default: ${{ github.token }} | ||
| image_tag: |
There was a problem hiding this comment.
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
Summary
Description of changes
Related issues
Checklist
verifiedlabel should appear next to all of your commits on GitHub.