Skip to content

Commit 97bd3f5

Browse files
add commit branch variable
1 parent d3a0714 commit 97bd3f5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/build_layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Build layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}
3838
run: |
3939
echo "Building layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}"
40-
ARCH=${{ matrix.arch }} PYTHON_VERSION=${{ matrix.python_version }} SED_EXPRESSION="s|(ddtrace = )\[[^]]*]|\1{ file = "${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" }|g" ./scripts/build_layers.sh
40+
ARCH=${{ matrix.arch }} PYTHON_VERSION=${{ matrix.python_version }} DD_TRACE_WHEEL="${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" ./scripts/build_layers.sh
4141
4242
- name: Upload layer artifact
4343
uses: actions/upload-artifact@v4

scripts/build_layers.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ else
4646
PYTHON_VERSIONS=$PYTHON_VERSION
4747
fi
4848

49-
if [ -z "$SED_EXPRESSION"]; then
50-
sed -z -E -i "$SED_EXPRESSION" pyproject.toml
49+
if [ -z "$DD_TRACE_COMMIT_BRANCH" ]; then
50+
sed -z -E -i 's|(ddtrace = )\[[^]]*]|\1{ git = "https://github.com/DataDog/dd-trace-py.git", branch = \"'"$DD_TRACE_COMMIT_BRANCH"'\" }|g' pyproject.toml
51+
else
52+
if [ -z "$DD_TRACE_WHEEL" ]; then
53+
sed -z -E -i 's|(ddtrace = )\[[^]]*]|\1{ file = "'"$DD_TRACE_WHEEL"'" }|g' pyproject.toml
54+
fi
5155
fi
5256

5357
function make_path_absolute {

0 commit comments

Comments
 (0)