-
Notifications
You must be signed in to change notification settings - Fork 9
Main => Prod #177
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
Main => Prod #177
Changes from all commits
32947eb
ce55d33
b988a88
c74bc4b
a1b64e5
af6add3
84a9fe2
5f138af
5485668
541c5b8
8ac2577
034c51f
71e6430
14ec1e6
f90d48a
b4f0d8c
3e44359
1062f0b
b33606f
d459364
0634212
021f1f5
1f65d5b
8c2a84e
108973e
a7056a1
450bceb
a6df5ed
0055c57
cc15f01
ced7eb1
bbd9b0a
583f3cd
0de3964
83c7da1
61e9bb0
d649e74
5a3840e
082d89f
9238e46
1ae25d6
3b8a878
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,106 @@ | ||
| name: Manual E2E Validation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| sdk_branch: | ||
| description: 'SDK branch to test' | ||
| required: true | ||
| default: 'main' | ||
| type: string | ||
| ui_branch: | ||
| description: 'agents-ui branch to test' | ||
| required: true | ||
| default: 'staging' | ||
| type: string | ||
|
|
||
| jobs: | ||
| e2e-validation: | ||
| runs-on: ${{ github.event.inputs.ui_branch == 'prod' && 'ubuntu-latest' || 'aws-medium' }} | ||
| timeout-minutes: 30 | ||
| environment: | ||
| name: ${{ github.event.inputs.ui_branch == 'prod' && 'prod' || 'staging' }} | ||
| env: | ||
| ENV: ${{ github.event.inputs.ui_branch == 'prod' && 'prod' || 'staging' }} | ||
|
|
||
| steps: | ||
| - name: Checkout SDK branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: agents-sdk | ||
| ref: ${{ github.event.inputs.sdk_branch }} | ||
|
|
||
| - name: Setup Node.js for SDK | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache-dependency-path: agents-sdk/yarn.lock | ||
|
|
||
| - name: Install Yarn | ||
| run: npm install -g yarn | ||
|
|
||
| - name: Install SDK dependencies | ||
| working-directory: agents-sdk | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Build SDK | ||
| working-directory: agents-sdk | ||
| run: yarn build | ||
|
|
||
| - name: Pack SDK for testing | ||
| working-directory: agents-sdk | ||
| run: | | ||
| npm pack | ||
| echo "SDK_PACKAGE=$(ls *.tgz)" >> $GITHUB_ENV | ||
|
|
||
| - name: Checkout agents-ui branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: de-id/agents-ui | ||
| ref: ${{ github.event.inputs.ui_branch }} | ||
| path: agents-ui | ||
| token: ${{ secrets.DEVOPS_TOKEN }} | ||
|
|
||
| - name: Set github environment variables | ||
| uses: rlespinasse/github-slug-action@v4 | ||
|
|
||
| - name: Setup Node.js for agents-ui | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Render .npmrc for agents-ui | ||
| working-directory: agents-ui | ||
| run: | | ||
| if [ -f .npmrc.template ]; then | ||
| sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_TOKEN }}/g" .npmrc.template > .npmrc | ||
| fi | ||
|
|
||
| - name: Install local SDK build in agents-ui | ||
| working-directory: agents-ui | ||
| run: | | ||
| yarn remove @d-id/client-sdk || true | ||
| yarn add file:../agents-sdk/${{ env.SDK_PACKAGE }} | ||
| yarn install --frozen-lockfile | ||
|
|
||
| - name: Install Playwright Chrome | ||
| working-directory: agents-ui | ||
| run: yarn playwright install chrome | ||
|
|
||
| - name: Run E2E tests | ||
| working-directory: agents-ui | ||
| env: | ||
| E2E_USER_APIKEY: ${{ secrets.E2E_USER_APIKEY }} | ||
| VITE_CLIENT_KEY: ${{ secrets.VITE_CLIENT_KEY }} | ||
| ASSERT_CHAT_RESTART: 'false' | ||
| run: yarn test:${{ github.event.inputs.ui_branch == 'prod' && 'prod' || 'staging' }} | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-test-results-manual-${{ github.event.inputs.sdk_branch }}-${{ github.event.inputs.ui_branch }} | ||
| path: | | ||
| agents-ui/playwright-report/ | ||
| agents-ui/test-results/ | ||
| retention-days: 30 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,101 @@ | ||||||||||||||||||||
| name: UI prod e2e with local sdk build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| pull_request: | ||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||
| types: [opened, synchronize, reopened] | ||||||||||||||||||||
|
|
||||||||||||||||||||
| concurrency: | ||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| e2e-validation: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||
| environment: | ||||||||||||||||||||
| name: prod | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| ENV: prod | ||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout SDK branch | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| path: agents-sdk | ||||||||||||||||||||
| ref: ${{ github.head_ref || github.ref_name }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Setup Node.js for SDK | ||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||
| cache-dependency-path: agents-sdk/yarn.lock | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install Yarn | ||||||||||||||||||||
| run: npm install -g yarn | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install SDK dependencies | ||||||||||||||||||||
| working-directory: agents-sdk | ||||||||||||||||||||
| run: yarn install --frozen-lockfile | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build SDK | ||||||||||||||||||||
| working-directory: agents-sdk | ||||||||||||||||||||
| run: yarn build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Pack SDK for testing | ||||||||||||||||||||
| working-directory: agents-sdk | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| npm pack | ||||||||||||||||||||
| echo "SDK_PACKAGE=$(ls *.tgz)" >> $GITHUB_ENV | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Checkout agents-ui production branch | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| repository: de-id/agents-ui | ||||||||||||||||||||
| ref: prod | ||||||||||||||||||||
| path: agents-ui | ||||||||||||||||||||
| token: ${{ secrets.DEVOPS_TOKEN }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set github environment variables | ||||||||||||||||||||
| uses: rlespinasse/github-slug-action@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Setup Node.js for agents-ui | ||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Render .npmrc for agents-ui | ||||||||||||||||||||
| working-directory: agents-ui | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| if [ -f .npmrc.template ]; then | ||||||||||||||||||||
| sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_TOKEN }}/g" .npmrc.template > .npmrc | ||||||||||||||||||||
| fi | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install local SDK build in agents-ui | ||||||||||||||||||||
| working-directory: agents-ui | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| yarn remove @d-id/client-sdk || true | ||||||||||||||||||||
| yarn add file:../agents-sdk/${{ env.SDK_PACKAGE }} | ||||||||||||||||||||
| yarn install --frozen-lockfile | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install Playwright Chrome | ||||||||||||||||||||
| working-directory: agents-ui | ||||||||||||||||||||
| run: yarn playwright install chrome | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run E2E tests against production | ||||||||||||||||||||
| working-directory: agents-ui | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| E2E_USER_APIKEY: ${{ secrets.E2E_USER_APIKEY }} | ||||||||||||||||||||
| VITE_CLIENT_KEY: ${{ secrets.VITE_CLIENT_KEY }} | ||||||||||||||||||||
| ASSERT_CHAT_RESTART: 'false' | ||||||||||||||||||||
| run: yarn test:prod | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Upload test results | ||||||||||||||||||||
| if: always() | ||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: e2e-test-results-main-pr-${{ github.event.number }} | ||||||||||||||||||||
| path: | | ||||||||||||||||||||
| agents-ui/playwright-report/ | ||||||||||||||||||||
| agents-ui/test-results/ | ||||||||||||||||||||
| retention-days: 30 | ||||||||||||||||||||
|
Comment on lines
+14
to
+101
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 9 months ago To fix the problem, add a Add the following block after the permissions:
contents: readNo additional imports or dependencies are required.
Suggested changeset
1
.github/workflows/pr-main-e2e.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Refresh and try again.
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: UI prod e2e with staging sdk build | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [prod] | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| e2e-validation: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| environment: | ||
| name: prod | ||
| env: | ||
| ENV: prod | ||
|
|
||
| steps: | ||
| - name: Checkout agents-ui production branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: de-id/agents-ui | ||
| ref: prod | ||
| path: agents-ui | ||
| fetch-depth: 0 | ||
| lfs: true | ||
| token: ${{ secrets.DEVOPS_TOKEN }} | ||
|
|
||
| - name: Set github environment variables | ||
| uses: rlespinasse/github-slug-action@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Render .npmrc for agents-ui | ||
| working-directory: agents-ui | ||
| run: | | ||
| if [ -f .npmrc.template ]; then | ||
| envsubst < .npmrc.template > .npmrc | ||
| fi | ||
| env: | ||
| NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Install staging SDK version | ||
| working-directory: agents-ui | ||
| run: | | ||
| yarn remove @d-id/client-sdk || true | ||
| yarn add @d-id/client-sdk@staging | ||
| npm install -g yarn && yarn | ||
|
|
||
| - name: Run E2E tests against production environment | ||
| working-directory: agents-ui | ||
| env: | ||
| E2E_USER_APIKEY: ${{ secrets.E2E_USER_APIKEY }} | ||
| VITE_CLIENT_KEY: ${{ secrets.VITE_CLIENT_KEY }} | ||
| run: yarn test:prod | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-test-results-prod-pr-${{ github.event.number }} | ||
| path: | | ||
| agents-ui/playwright-report/ | ||
| agents-ui/test-results/ | ||
| retention-days: 30 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 9 months ago
To fix the problem, add a
permissionsblock to the workflow to explicitly restrict the permissions granted to theGITHUB_TOKEN. The best way is to add the block at the root level of the workflow file, so it applies to all jobs unless overridden. For this workflow, the minimal required permission is likelycontents: read, as the workflow checks out code and uploads artifacts but does not push changes or create pull requests. Add the following block after thename:and before theon:section:No additional imports, methods, or definitions are needed. Only a single block of YAML needs to be inserted.