-
Notifications
You must be signed in to change notification settings - Fork 0
Move alarms to Terraform #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
18d551d
6ede5aa
ac049b5
5b83633
aaf4eb9
573fcc8
3fbcb42
bac761f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,130 @@ | ||||||||||||||||||||
| name: Deploy all resources to PROD (Manual) | ||||||||||||||||||||
| run-name: Manual PROD deploy - @${{ github.actor }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| test: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||
| name: Run Unit Tests | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| HUSKY: "0" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Node | ||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 22.x | ||||||||||||||||||||
| cache: "yarn" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Setup Terraform | ||||||||||||||||||||
| uses: hashicorp/setup-terraform@v2 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| terraform_version: 1.12.2 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Restore Yarn Cache | ||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| path: node_modules | ||||||||||||||||||||
| key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev | ||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||
| yarn-modules-${{ runner.arch }}-${{ runner.os }}- | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run unit testing | ||||||||||||||||||||
| run: make test_unit | ||||||||||||||||||||
|
|
||||||||||||||||||||
| build: | ||||||||||||||||||||
| runs-on: ubuntu-24.04-arm | ||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||
| name: Build Application | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| HUSKY: "0" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Node | ||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 22.x | ||||||||||||||||||||
| cache: "yarn" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Restore Yarn Cache | ||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| path: node_modules | ||||||||||||||||||||
| key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-prod | ||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||
| yarn-modules-${{ runner.arch }}-${{ runner.os }}- | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run build | ||||||||||||||||||||
| run: make build | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| HUSKY: "0" | ||||||||||||||||||||
| VITE_RUN_ENVIRONMENT: prod | ||||||||||||||||||||
| RunEnvironment: prod | ||||||||||||||||||||
| VITE_BUILD_HASH: ${{ github.sha }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Upload Build files | ||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| include-hidden-files: true | ||||||||||||||||||||
| name: build-prod | ||||||||||||||||||||
| path: | | ||||||||||||||||||||
| .aws-sam/ | ||||||||||||||||||||
| dist/ | ||||||||||||||||||||
| dist_ui/ | ||||||||||||||||||||
|
|
||||||||||||||||||||
| deploy-prod: | ||||||||||||||||||||
|
Comment on lines
+40
to
+80
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 4 months ago To fix the issue, we will add a
Suggested changeset
1
.github/workflows/manual-prod.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| name: Deploy to Prod and Run Health Check | ||||||||||||||||||||
| concurrency: | ||||||||||||||||||||
| group: ${{ github.event.repository.name }}-prod | ||||||||||||||||||||
| cancel-in-progress: false | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| id-token: write | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| needs: | ||||||||||||||||||||
| - test | ||||||||||||||||||||
| - build | ||||||||||||||||||||
| environment: "AWS PROD" | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Set up Node for testing | ||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 22.x | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Setup Terraform | ||||||||||||||||||||
| uses: hashicorp/setup-terraform@v2 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| terraform_version: 1.12.2 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| HUSKY: "0" | ||||||||||||||||||||
| - uses: aws-actions/setup-sam@v2 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| use-installer: true | ||||||||||||||||||||
| - name: Set up Python 3.11 | ||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| python-version: 3.11 | ||||||||||||||||||||
| - name: Download Build files | ||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: build-prod | ||||||||||||||||||||
| - uses: aws-actions/configure-aws-credentials@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| role-to-assume: arn:aws:iam::298118738376:role/GitHubActionsRole | ||||||||||||||||||||
| role-session-name: Manual_Core_Prod_Deployment_${{ github.run_id }} | ||||||||||||||||||||
| aws-region: us-east-1 | ||||||||||||||||||||
| - name: Publish to AWS | ||||||||||||||||||||
| run: make deploy_prod | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| HUSKY: "0" | ||||||||||||||||||||
| VITE_RUN_ENVIRONMENT: prod | ||||||||||||||||||||
| - name: Call the health check script | ||||||||||||||||||||
| run: make prod_health_check | ||||||||||||||||||||
This file was deleted.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 4 months ago
To fix the issue, we will add an explicit
permissionsblock to thetestandbuildjobs. These jobs only require read access to the repository contents, so we will setcontents: readas the permission. This ensures that the jobs do not have unnecessary write access, reducing the risk of unintended modifications.