Skip to content

Commit 551fe98

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 551fe98

File tree

1 file changed

+40
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)