Skip to content

Commit d2480b9

Browse files
authored
sync .github folder with main branch (#55)
*Issue #, if available:* *Description of changes:* Reset the .github folder with the one in main branch so that next time we can do normal release (without modifying the workflow in release branch manually) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent a711b51 commit d2480b9

File tree

5 files changed

+155
-63
lines changed

5 files changed

+155
-63
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# https://help.github.com/en/articles/about-code-owners
33

44
# Default owners for the entire repo
5-
* @aws-observability/aws-application-signals-team
5+
* @aws-observability/aws-application-signals-maintainers

.github/actions/artifacts_build/action.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,41 +66,41 @@ runs:
6666
cd aws-distro-opentelemetry-node-autoinstrumentation
6767
npm pack
6868
69-
# - name: Set up QEMU
70-
# uses: docker/setup-qemu-action@v3
69+
- name: Set up QEMU
70+
uses: docker/setup-qemu-action@v3
7171

72-
# - name: Set up Docker Buildx
73-
# uses: docker/setup-buildx-action@v3
72+
- name: Set up Docker Buildx
73+
uses: docker/setup-buildx-action@v3
7474

75-
# - name: Login to private AWS ECR
76-
# if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
77-
# uses: docker/login-action@v3
78-
# with:
79-
# registry: ${{ inputs.image_registry }}
80-
# env:
81-
# AWS_REGION: ${{ inputs.aws-region }}
75+
- name: Login to private AWS ECR
76+
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
77+
uses: docker/login-action@v3
78+
with:
79+
registry: ${{ inputs.image_registry }}
80+
env:
81+
AWS_REGION: ${{ inputs.aws-region }}
8282

8383
# Per https://docs.aws.amazon.com/AmazonECR/latest/public/docker-pull-ecr-image.html, it is possible to
8484
# make unauthorized calls to get public ECR images (needed to build the ADOT Node docker image), but
8585
# it can fail if you previously authenticated to a public repo. Adding this step to log out, so we
8686
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
8787
# PRs created from forked repos.
88-
# - name: Logout of public AWS ECR
89-
# shell: bash
90-
# run: docker logout public.ecr.aws
88+
- name: Logout of public AWS ECR
89+
shell: bash
90+
run: docker logout public.ecr.aws
9191

92-
# - name: Build and push image according to input
93-
# uses: docker/build-push-action@v5
94-
# with:
95-
# push: ${{ inputs.push_image }}
96-
# context: .
97-
# file: ./Dockerfile
98-
# platforms: linux/amd64
99-
# tags: ${{ inputs.image_uri_with_tag }}
100-
# load: ${{ inputs.load_image }}
92+
- name: Build and push image according to input
93+
uses: docker/build-push-action@v5
94+
with:
95+
push: ${{ inputs.push_image }}
96+
context: .
97+
file: ./Dockerfile
98+
platforms: linux/amd64
99+
tags: ${{ inputs.image_uri_with_tag }}
100+
load: ${{ inputs.load_image }}
101101

102-
# - name: Perform image scan
103-
# uses: ./.github/actions/image_scan
104-
# with:
105-
# image-ref: ${{ inputs.image_uri_with_tag }}
106-
# severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
102+
- name: Perform image scan
103+
uses: ./.github/actions/image_scan
104+
with:
105+
image-ref: ${{ inputs.image_uri_with_tag }}
106+
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

.github/workflows/codeql.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main", "release/v*" ]
17+
pull_request:
18+
branches: [ "main", "release/v*" ]
19+
schedule:
20+
- cron: '42 4 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: javascript-typescript
47+
build-mode: none
48+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# 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
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
build-mode: ${{ matrix.build-mode }}
66+
# If you wish to specify custom queries, you can do so here or in a config file.
67+
# By default, queries listed here will override any specified in a config file.
68+
# Prefix the list here with "+" to use these queries and those in the config file.
69+
70+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# queries: security-extended,security-and-quality
72+
73+
# If the analyze step fails for one of the languages you are analyzing with
74+
# "We were unable to automatically build your code", modify the matrix above
75+
# to set the build mode to "manual" for that language. Then modify this step
76+
# to build your code.
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
- if: matrix.build-mode == 'manual'
80+
shell: bash
81+
run: |
82+
echo 'If you are using a "manual" build mode for one or more of the' \
83+
'languages you are analyzing, replace this with the commands to build' \
84+
'your code, for example:'
85+
echo ' make bootstrap'
86+
echo ' make release'
87+
exit 1
88+
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@v3
91+
with:
92+
category: "/language:${{matrix.language}}"

.github/workflows/daily-scan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
id: high_scan
7474
uses: ./.github/actions/image_scan
7575
with:
76-
image-ref: "637423224110.dkr.ecr.us-east-1.amazonaws.com/aws-observability/adot-autoinstrumentation-node-staging:latest"
76+
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.1.0"
7777
severity: 'CRITICAL,HIGH'
7878

7979
# TODO: Update image to public once available
@@ -82,7 +82,7 @@ jobs:
8282
id: low_scan
8383
uses: ./.github/actions/image_scan
8484
with:
85-
image-ref: "637423224110.dkr.ecr.us-east-1.amazonaws.com/aws-observability/adot-autoinstrumentation-node-staging:latest"
85+
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.1.0"
8686
severity: 'MEDIUM,LOW,UNKNOWN'
8787

8888
- name: Configure AWS Credentials for emitting metrics
@@ -108,4 +108,4 @@ jobs:
108108
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
109109
--metric-name Success \
110110
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=daily_scan_low \
111-
--value $value
111+
--value $value

.github/workflows/release-build.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,45 @@ jobs:
6464
registry: public.ecr.aws
6565

6666

67-
# # Publish to public ECR
68-
# - name: Build and push public ECR image
69-
# uses: docker/build-push-action@v5
70-
# with:
71-
# push: true
72-
# context: .
73-
# file: ./Dockerfile
74-
# platforms: linux/amd64,linux/arm64
75-
# tags: |
76-
# ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ github.event.inputs.version }}
67+
# Publish to public ECR
68+
- name: Build and push public ECR image
69+
uses: docker/build-push-action@v5
70+
with:
71+
push: true
72+
context: .
73+
file: ./Dockerfile
74+
platforms: linux/amd64,linux/arm64
75+
tags: |
76+
${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ github.event.inputs.version }}
7777
78-
# # Publish to private ECR
79-
# - name: Build and push private ECR image
80-
# uses: docker/build-push-action@v5
81-
# with:
82-
# push: true
83-
# context: .
84-
# file: ./Dockerfile
85-
# platforms: linux/amd64,linux/arm64
86-
# tags: |
87-
# ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }}
78+
# Publish to private ECR
79+
- name: Build and push private ECR image
80+
uses: docker/build-push-action@v5
81+
with:
82+
push: true
83+
context: .
84+
file: ./Dockerfile
85+
platforms: linux/amd64,linux/arm64
86+
tags: |
87+
${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }}
8888
8989
# Publish to GitHub releases
90-
# - name: Create GH release
91-
# id: create_release
92-
# env:
93-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
94-
# run: |
95-
# gh release create --target "$GITHUB_REF_NAME" \
96-
# --title "Release v${{ github.event.inputs.version }}" \
97-
# --draft \
98-
# "v${{ github.event.inputs.version }}" \
99-
# aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz
90+
- name: Create GH release
91+
id: create_release
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
94+
run: |
95+
gh release create --target "$GITHUB_REF_NAME" \
96+
--title "Release v${{ github.event.inputs.version }}" \
97+
--draft \
98+
"v${{ github.event.inputs.version }}" \
99+
aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz
100100
101101
# Publish to npm
102102
- name: Publish to npm
103103
env:
104104
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
105105
NPM_CONFIG_PROVENANCE: true
106-
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes --loglevel verbose
106+
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
107107

108108

0 commit comments

Comments
 (0)