Skip to content

Commit 657fb80

Browse files
committed
Merge branch 'main' into zhaez/merge-releases
2 parents d1a406f + d4fa47e commit 657fb80

File tree

12 files changed

+131
-42
lines changed

12 files changed

+131
-42
lines changed

.github/actions/artifacts_build/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runs:
5353

5454
- name: Configure AWS Credentials
5555
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
56-
uses: aws-actions/configure-aws-credentials@v4
56+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
5757
with:
5858
role-to-assume: ${{ inputs.snapshot-ecr-role }}
5959
aws-region: ${{ inputs.aws-region }}
@@ -68,14 +68,14 @@ runs:
6868
python -m build --outdir ../dist
6969
7070
- name: Set up QEMU
71-
uses: docker/setup-qemu-action@v3
71+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #3.6.0
7272

7373
- name: Set up Docker Buildx
74-
uses: docker/setup-buildx-action@v3
74+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
7575

7676
- name: Login to private AWS ECR
7777
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
78-
uses: docker/login-action@v3
78+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 #v3.5.0
7979
with:
8080
registry: ${{ inputs.image_registry }}
8181
env:
@@ -91,7 +91,7 @@ runs:
9191
run: docker logout public.ecr.aws
9292

9393
- name: Build and push image according to input
94-
uses: docker/build-push-action@v5
94+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #6.18.0
9595
with:
9696
push: ${{ inputs.push_image }}
9797
context: .

.github/actions/image_scan/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
run: docker logout public.ecr.aws
3333

3434
- name: Run Trivy vulnerability scanner on image
35-
uses: aquasecurity/trivy-action@master
35+
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
3636
with:
3737
image-ref: ${{ inputs.image-ref }}
3838
severity: ${{ inputs.severity }}

.github/actions/set_up/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runs:
2121
using: "composite"
2222
steps:
2323
- name: Set up Python
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
2525
with:
2626
python-version: ${{ inputs.python_version }}
2727

@@ -31,7 +31,7 @@ runs:
3131

3232
- name: Cache tox environment
3333
# Preserves .tox directory between runs for faster installs
34-
uses: actions/cache@v3
34+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 #4.2.4
3535
with:
3636
path: |
3737
.tox

.github/workflows/application-signals-e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Configure AWS Credentials
32-
uses: aws-actions/configure-aws-credentials@v4
32+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
3333
with:
3434
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
3535
aws-region: us-east-1
3636

37-
- uses: actions/download-artifact@v4
37+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 #5.0.0
3838
with:
3939
name: ${{ inputs.staging-wheel-name }}
4040

.github/workflows/codeql.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ jobs:
6060
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@v4
63+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
6464

6565
# Initializes the CodeQL tools for scanning.
6666
- name: Initialize CodeQL
67-
uses: github/codeql-action/init@v3
67+
uses: github/codeql-action/init@16df4fbc19aea13d921737861d6c622bf3cefe23 #v2.23.0
6868
with:
6969
languages: ${{ matrix.language }}
7070
build-mode: ${{ matrix.build-mode }}
@@ -92,6 +92,41 @@ jobs:
9292
exit 1
9393
9494
- name: Perform CodeQL Analysis
95-
uses: github/codeql-action/analyze@v3
95+
uses: github/codeql-action/analyze@16df4fbc19aea13d921737861d6c622bf3cefe23 #v2.23.0
9696
with:
9797
category: "/language:${{matrix.language}}"
98+
99+
all-codeql-checks-pass:
100+
runs-on: ubuntu-latest
101+
needs: [analyze]
102+
if: always()
103+
steps:
104+
- name: Checkout to get workflow file
105+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
106+
107+
- name: Check all jobs succeeded and none missing
108+
run: |
109+
# Check if all needed jobs succeeded
110+
results='${{ toJSON(needs) }}'
111+
if echo "$results" | jq -r '.[] | .result' | grep -v success; then
112+
echo "Some jobs failed"
113+
exit 1
114+
fi
115+
116+
# Extract all job names from workflow (excluding this gate job)
117+
all_jobs=$(yq eval '.jobs | keys | .[]' .github/workflows/codeql.yml | grep -v "all-codeql-checks-pass" | sort)
118+
119+
# Extract job names from needs array
120+
needed_jobs='${{ toJSON(needs) }}'
121+
needs_list=$(echo "$needed_jobs" | jq -r 'keys[]' | sort)
122+
123+
# Check if any jobs are missing from needs
124+
missing_jobs=$(comm -23 <(echo "$all_jobs") <(echo "$needs_list"))
125+
if [ -n "$missing_jobs" ]; then
126+
echo "ERROR: Jobs missing from needs array in all-codeql-checks-pass:"
127+
echo "$missing_jobs"
128+
echo "Please add these jobs to the needs array of all-codeql-checks-pass"
129+
exit 1
130+
fi
131+
132+
echo "All CodeQL checks passed and no jobs missing from gate!"

.github/workflows/daily-scan.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout repo for dependency scan
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
3030
with:
3131
fetch-depth: 0
3232

3333
- name: Set up Python for dependency scan
34-
uses: actions/setup-python@v4
34+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
3535
with:
3636
python-version: "3.10"
3737

@@ -44,19 +44,19 @@ jobs:
4444
less aws-opentelemetry-distro/requirements.txt
4545
4646
- name: Install java for dependency scan
47-
uses: actions/setup-java@v4
47+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 #v5.0.0
4848
with:
4949
java-version: 17
5050
distribution: 'temurin'
5151

5252
- name: Configure AWS credentials for dependency scan
53-
uses: aws-actions/configure-aws-credentials@v4
53+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
5454
with:
5555
role-to-assume: ${{ secrets.SECRET_MANAGER_ROLE_ARN }}
5656
aws-region: ${{ env.AWS_DEFAULT_REGION }}
5757

5858
- name: Get NVD API key for dependency scan
59-
uses: aws-actions/aws-secretsmanager-get-secrets@v1
59+
uses: aws-actions/aws-secretsmanager-get-secrets@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 #v2.0.10
6060
id: nvd_api_key
6161
with:
6262
secret-ids: ${{ secrets.NVD_API_KEY_SECRET_ARN }}
@@ -80,13 +80,13 @@ jobs:
8080
run: less dependency-check-report.html
8181

8282
- name: Configure AWS credentials for image scan
83-
uses: aws-actions/configure-aws-credentials@v4
83+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
8484
with:
8585
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
8686
aws-region: ${{ env.AWS_DEFAULT_REGION }}
8787

8888
- name: Login to Public ECR
89-
uses: docker/login-action@v3
89+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 #v3.5.0
9090
with:
9191
registry: public.ecr.aws
9292

@@ -110,7 +110,7 @@ jobs:
110110

111111
- name: Configure AWS Credentials for emitting metrics
112112
if: always()
113-
uses: aws-actions/configure-aws-credentials@v4
113+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
114114
with:
115115
role-to-assume: ${{ secrets.MONITORING_ROLE_ARN }}
116116
aws-region: ${{ env.AWS_DEFAULT_REGION }}

.github/workflows/main-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
staging_wheel_file: ${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
3434
steps:
3535
- name: Checkout Repo @ SHA - ${{ github.sha }}
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
3737

3838
- name: Get Python Distro Output
3939
id: python_output
@@ -87,7 +87,7 @@ jobs:
8787
aws s3 cp dist/${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}} s3://${{ env.STAGING_S3_BUCKET }}
8888
8989
- name: Upload Wheel to GitHub Actions
90-
uses: actions/upload-artifact@v4
90+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
9191
with:
9292
name: ${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
9393
path: dist/${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
@@ -117,7 +117,7 @@ jobs:
117117
if: always()
118118
steps:
119119
- name: Configure AWS Credentials for emitting metrics
120-
uses: aws-actions/configure-aws-credentials@v4
120+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #5.0.0
121121
with:
122122
role-to-assume: ${{ secrets.MONITORING_ROLE_ARN }}
123123
aws-region: ${{ env.AWS_DEFAULT_REGION }}

.github/workflows/post-release-version-bump.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout main
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
2828
with:
2929
ref: main
3030
fetch-depth: 0
@@ -63,21 +63,21 @@ jobs:
6363
needs: check-version
6464
steps:
6565
- name: Configure AWS credentials for BOT secrets
66-
uses: aws-actions/configure-aws-credentials@v4
66+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #v5.0.0
6767
with:
6868
role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
6969
aws-region: ${{ env.AWS_DEFAULT_REGION }}
7070

7171
- name: Get Bot secrets
72-
uses: aws-actions/aws-secretsmanager-get-secrets@v1
72+
uses: aws-actions/aws-secretsmanager-get-secrets@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 #v2.0.10
7373
id: bot_secrets
7474
with:
7575
secret-ids: |
7676
BOT_TOKEN ,${{ secrets.BOT_TOKEN_SECRET_ARN }}
7777
parse-json-secrets: true
7878

7979
- name: Setup Git
80-
uses: actions/checkout@v2
80+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
8181
with:
8282
fetch-depth: 0
8383
token: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}

.github/workflows/pr-build.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
changelog-check:
19+
static-code-checks:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
2323
with:
2424
fetch-depth: 0
2525

2626
- name: Check CHANGELOG
27+
if: always()
2728
run: |
2829
# Check if PR is from workflows bot or dependabot
2930
if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then
@@ -52,6 +53,24 @@ jobs:
5253
echo "It looks like you didn't add an entry to CHANGELOG.md. If this change affects the SDK behavior, please update CHANGELOG.md and link this PR in your entry. If this PR does not need a CHANGELOG entry, you can add the 'Skip Changelog' label to this PR."
5354
exit 1
5455
56+
- name: Check for versioned GitHub actions
57+
if: always()
58+
run: |
59+
# Get changed GitHub workflow/action files
60+
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -E "^\.github/(workflows|actions)/.*\.ya?ml$" || true)
61+
62+
if [ -n "$CHANGED_FILES" ]; then
63+
# Check for any versioned actions, excluding comments and this validation script
64+
VIOLATIONS=$(grep -Hn "uses:.*@v" $CHANGED_FILES | grep -v "grep.*uses:.*@v" | grep -v "#.*@v" || true)
65+
if [ -n "$VIOLATIONS" ]; then
66+
echo "Found versioned GitHub actions. Use commit SHAs instead:"
67+
echo "$VIOLATIONS"
68+
exit 1
69+
fi
70+
fi
71+
72+
echo "No versioned actions found in changed files"
73+
5574
build:
5675
runs-on: ubuntu-latest
5776
strategy:
@@ -142,3 +161,38 @@ jobs:
142161

143162
- name: Build with Gradle
144163
run: cd performance-tests; ./gradlew spotlessCheck
164+
165+
all-pr-checks-pass:
166+
runs-on: ubuntu-latest
167+
needs: [static-code-checks, lint, spotless, build, build-lambda]
168+
if: always()
169+
steps:
170+
- name: Checkout to get workflow file
171+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5.0.0
172+
173+
- name: Check all jobs succeeded and none missing
174+
run: |
175+
# Check if all needed jobs succeeded
176+
results='${{ toJSON(needs) }}'
177+
if echo "$results" | jq -r '.[] | .result' | grep -v success; then
178+
echo "Some jobs failed"
179+
exit 1
180+
fi
181+
182+
# Extract all job names from workflow (excluding this gate job)
183+
all_jobs=$(yq eval '.jobs | keys | .[]' .github/workflows/pr-build.yml | grep -v "all-pr-checks-pass" | sort)
184+
185+
# Extract job names from needs array
186+
needed_jobs='${{ toJSON(needs) }}'
187+
needs_list=$(echo "$needed_jobs" | jq -r 'keys[]' | sort)
188+
189+
# Check if any jobs are missing from needs
190+
missing_jobs=$(comm -23 <(echo "$all_jobs") <(echo "$needs_list"))
191+
if [ -n "$missing_jobs" ]; then
192+
echo "ERROR: Jobs missing from needs array in all-pr-checks-pass:"
193+
echo "$missing_jobs"
194+
echo "Please add these jobs to the needs array of all-pr-checks-pass"
195+
exit 1
196+
fi
197+
198+
echo "All checks passed and no jobs missing from gate!"

.github/workflows/pre-release-prepare.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Configure AWS credentials for BOT secrets
28-
uses: aws-actions/configure-aws-credentials@v4
28+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #v5.0.0
2929
with:
3030
role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
3131
aws-region: ${{ env.AWS_DEFAULT_REGION }}
3232

3333
- name: Get Bot secrets
34-
uses: aws-actions/aws-secretsmanager-get-secrets@v1
34+
uses: aws-actions/aws-secretsmanager-get-secrets@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 #v2.0.10
3535
id: bot_secrets
3636
with:
3737
secret-ids: |
3838
BOT_TOKEN ,${{ secrets.BOT_TOKEN_SECRET_ARN }}
3939
parse-json-secrets: true
4040

4141
- name: Checkout main branch
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
4343
with:
4444
ref: 'main'
4545
token: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}

0 commit comments

Comments
 (0)