Skip to content

Commit 9d3a027

Browse files
committed
Add template for running D2D on project build and source archives
Signed-off-by: Keshav Priyadarshi <[email protected]>
1 parent 5641047 commit 9d3a027

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/d2d-template.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run D2D on build and source archives
2+
on:
3+
workflow_call:
4+
inputs:
5+
artifact-name:
6+
description: "Artifact name containing the build archive"
7+
required: true
8+
type: string
9+
archive-name:
10+
description: "Build archive file name"
11+
required: true
12+
type: string
13+
steps:
14+
description: "Comma separated D2D steps to run"
15+
required: false
16+
type: string
17+
18+
jobs:
19+
run-d2d-pipeline:
20+
runs-on: 'ubuntu-latest'
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Download build artifact
26+
uses: actions/download-artifact@v4
27+
with:
28+
name: ${{ inputs['artifact-name'] }}
29+
path: dist/
30+
31+
- name: Prepare D2D inputs
32+
shell: bash
33+
run: |
34+
mkdir -p scancode-inputs
35+
git archive --format=tar.gz -o scancode-inputs/from.tar.gz HEAD
36+
cp dist/${{ inputs['archive-name'] }} scancode-inputs/to_${{ inputs['archive-name'] }}
37+
rm -rf dist/
38+
39+
- name: Run D2D pipeline
40+
uses: aboutcode-org/scancode-action@beta
41+
with:
42+
pipelines: ${{ inputs.steps && format('map_deploy_to_develop:%s', inputs.steps) || 'map_deploy_to_develop' }}

0 commit comments

Comments
 (0)