-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add template for running D2D on project build and source archive #30
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| - [Where does the scan results go?](#where-are-the-scan-results) | ||
|
|
||
| ## Usage | ||
|
|
||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| ``` | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
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.
[Run source to binary mapping] should be enough as a title.