Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/map-deploy-to-develop-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run D2D on build and source archives
on:
workflow_call:
inputs:
artifact-name:
description: "Artifact containing the build archive"
required: true
type: string
steps:
description: "Comma separated D2D steps to run"
required: false
type: string

jobs:
run-d2d-pipeline:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs['artifact-name'] }}
path: ../scancode-inputs/

- name: Prepare D2D inputs
shell: bash
run: |
for file in ../scancode-inputs/*; do
base=$(basename "$file")
mv "$file" "../scancode-inputs/to_$base"
done
git archive --format=tar.gz -o ../scancode-inputs/from.tar.gz HEAD
- name: Run D2D pipeline
uses: aboutcode-org/scancode-action@beta
with:
pipelines: ${{ inputs.steps && format('map_deploy_to_develop:%s', inputs.steps) || 'map_deploy_to_develop' }}
inputs-path: ../scancode-inputs
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ from your **GitHub Workflows**.
- [Check for compliance issues](#check-for-compliance-issues)
- [Define a custom project name](#define-a-custom-project-name)
- [Install ScanCode.io from a repository branch](#install-scancodeio-from-a-repository-branch)
- [Where does the scan results go?](#where-does-the-scan-results-go)
- [Run source to binary mapping using GitHub action template](#run-source-to-binary-mapping-using-github-action-template)
Copy link
Contributor

Choose a reason for hiding this comment

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

[Run source to binary mapping] should be enough as a title.

- [Where does the scan results go?](#where-are-the-scan-results)

## Usage

Expand Down Expand Up @@ -226,6 +227,18 @@ Activate this behavior by enabling `check-compliance` and setting
scancodeio-repo-branch: "main"
```

### Run source to binary mapping using GitHub action template
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some context here, what is this for, why one would run this.

1. Add job to build your binary and upload it as a GitHub actions artifact.
Copy link
Contributor

Choose a reason for hiding this comment

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

Provide an example

2. Add a job to run `map-deploy-to-develop` pipeline.
```yaml
run-d2d-pipeline:
needs: # Job id from step 1
uses: aboutcode-org/scancode-action/.github/workflows/map-deploy-to-develop-template.yml
with:
artifact-name: # Label of uploaded artifact from step 1
steps: "python,java" # Comma separated optional steps. See https://scancodeio.readthedocs.io/en/latest/built-in-pipelines.html#map-deploy-to-develop
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a fully working examples, one for Python and one for Java for example.

## Where are the Scan Results?

Upon completion of the workflow, you can **find the scan results** in the dedicated
Expand Down