Skip to content

Commit 74cfb9d

Browse files
authored
Merge branch 'main' into fix-udp-workflow
2 parents d9ab40a + 9b5c640 commit 74cfb9d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/main-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ jobs:
256256
aws s3 cp ./build/distributions/aws-opentelemetry-java-layer.zip s3://adot-main-build-staging-jar/adot-java-lambda-layer-${{ github.run_id }}.zip
257257
258258
application-signals-e2e-test:
259+
name: "Application Signals E2E Test"
259260
needs: [build, application-signals-lambda-layer-build]
260261
uses: ./.github/workflows/application-signals-e2e-test.yml
261262
secrets: inherit

.github/workflows/release-build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v5
28+
29+
- name: Check main build status
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="Java Agent Main Build") | .id')
34+
LATEST_RUN=$(gh api repos/${{ github.repository }}/actions/workflows/$WORKFLOW_ID/runs --jq '[.workflow_runs[] | select(.head_branch=="${{ github.ref_name }}")] | sort_by(.created_at) | .[-1] | {conclusion, status}')
35+
STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
36+
CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
37+
38+
if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
39+
echo "Main build is still running (status: $STATUS). Cannot proceed with release."
40+
exit 1
41+
elif [ "$CONCLUSION" != "success" ]; then
42+
echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
43+
exit 1
44+
fi
45+
echo "Main build succeeded, proceeding with release"
2846
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2947
with:
3048
java-version-file: .java-version

0 commit comments

Comments
 (0)