From 1ebb54ee2d8c9cf0bca53b0278f32bdb8aa0dbc6 Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Mon, 21 Apr 2025 17:34:23 +0200 Subject: [PATCH 1/8] test --- .github/workflows/auto-change-prs-branch.yml | 9 ++++++++- .github/workflows/build-zip.yml | 9 ++++++++- .github/workflows/e2e.yml | 9 ++++++++- .github/workflows/lint.yml | 9 ++++++++- .github/workflows/prettier.yml | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-change-prs-branch.yml b/.github/workflows/auto-change-prs-branch.yml index 588a4602e..4014a6641 100644 --- a/.github/workflows/auto-change-prs-branch.yml +++ b/.github/workflows/auto-change-prs-branch.yml @@ -1,6 +1,13 @@ name: Make sure new PRs are sent to development -on: [ pull_request_target ] +on: + pull_request_target: + types: + - opened + - reopened + - ready_for_review + - edited + - synchronize jobs: check-branch: diff --git a/.github/workflows/build-zip.yml b/.github/workflows/build-zip.yml index 354f76986..36c000bd1 100644 --- a/.github/workflows/build-zip.yml +++ b/.github/workflows/build-zip.yml @@ -1,6 +1,13 @@ name: Build And Upload Extension Zip Via Artifact -on: [ pull_request_target ] +on: + pull_request_target: + types: + - opened + - reopened + - ready_for_review + - edited + - synchronize jobs: build: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 4f03b0bb9..78a1071e9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,6 +1,13 @@ name: Run E2E Tests -on: [ pull_request_target ] +on: + pull_request_target: + types: + - opened + - reopened + - ready_for_review + - edited + - synchronize jobs: chrome: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 921ad9b4f..4c3fe4299 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,13 @@ name: Lint Check -on: [ pull_request_target ] +on: + pull_request_target: + types: + - opened + - reopened + - ready_for_review + - edited + - synchronize jobs: eslint: diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index d806e22d8..9f053a3bd 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -1,6 +1,13 @@ name: Formating validation -on: [ pull_request_target ] +on: + pull_request_target: + types: + - opened + - reopened + - ready_for_review + - edited + - synchronize jobs: prettier: From 5e7fd629b9d7776a88b72dc8d69f72de03d472cb Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Mon, 21 Apr 2025 17:58:42 +0200 Subject: [PATCH 2/8] test --- .github/workflows/auto-change-prs-branch.yml | 6 ------ .github/workflows/build-zip.yml | 6 ------ .github/workflows/e2e.yml | 6 ------ .github/workflows/lint.yml | 6 ------ .github/workflows/prettier.yml | 6 ------ 5 files changed, 30 deletions(-) diff --git a/.github/workflows/auto-change-prs-branch.yml b/.github/workflows/auto-change-prs-branch.yml index 4014a6641..5db306e31 100644 --- a/.github/workflows/auto-change-prs-branch.yml +++ b/.github/workflows/auto-change-prs-branch.yml @@ -2,12 +2,6 @@ name: Make sure new PRs are sent to development on: pull_request_target: - types: - - opened - - reopened - - ready_for_review - - edited - - synchronize jobs: check-branch: diff --git a/.github/workflows/build-zip.yml b/.github/workflows/build-zip.yml index 36c000bd1..05502a06e 100644 --- a/.github/workflows/build-zip.yml +++ b/.github/workflows/build-zip.yml @@ -2,12 +2,6 @@ name: Build And Upload Extension Zip Via Artifact on: pull_request_target: - types: - - opened - - reopened - - ready_for_review - - edited - - synchronize jobs: build: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 78a1071e9..300ff3b11 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,12 +2,6 @@ name: Run E2E Tests on: pull_request_target: - types: - - opened - - reopened - - ready_for_review - - edited - - synchronize jobs: chrome: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c3fe4299..c8016e385 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,12 +2,6 @@ name: Lint Check on: pull_request_target: - types: - - opened - - reopened - - ready_for_review - - edited - - synchronize jobs: eslint: diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 9f053a3bd..ee8e100ba 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -2,12 +2,6 @@ name: Formating validation on: pull_request_target: - types: - - opened - - reopened - - ready_for_review - - edited - - synchronize jobs: prettier: From 077b7625f5e1dae512a5a2861ca2bf35b230ea0e Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Mon, 21 Apr 2025 18:02:30 +0200 Subject: [PATCH 3/8] test --- .github/workflows/auto-change-prs-branch.yml | 4 ++++ .github/workflows/build-zip.yml | 4 ++++ .github/workflows/e2e.yml | 4 ++++ .github/workflows/lint.yml | 4 ++++ .github/workflows/prettier.yml | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/.github/workflows/auto-change-prs-branch.yml b/.github/workflows/auto-change-prs-branch.yml index 5db306e31..b42be9806 100644 --- a/.github/workflows/auto-change-prs-branch.yml +++ b/.github/workflows/auto-change-prs-branch.yml @@ -2,6 +2,10 @@ name: Make sure new PRs are sent to development on: pull_request_target: + types: + - opened + - reopened + - synchronize jobs: check-branch: diff --git a/.github/workflows/build-zip.yml b/.github/workflows/build-zip.yml index 05502a06e..f7c9e6b18 100644 --- a/.github/workflows/build-zip.yml +++ b/.github/workflows/build-zip.yml @@ -2,6 +2,10 @@ name: Build And Upload Extension Zip Via Artifact on: pull_request_target: + types: + - opened + - reopened + - synchronize jobs: build: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 300ff3b11..037793570 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,6 +2,10 @@ name: Run E2E Tests on: pull_request_target: + types: + - opened + - reopened + - synchronize jobs: chrome: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c8016e385..3450e8506 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,6 +2,10 @@ name: Lint Check on: pull_request_target: + types: + - opened + - reopened + - synchronize jobs: eslint: diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index ee8e100ba..e86fb5ee1 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -2,6 +2,10 @@ name: Formating validation on: pull_request_target: + types: + - opened + - reopened + - synchronize jobs: prettier: From 1bbc8f3ff270b11b0d5181ffe18feb0b96c6768e Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Mon, 21 Apr 2025 18:04:02 +0200 Subject: [PATCH 4/8] test --- .github/workflows/auto-change-prs-branch.yml | 1 + .github/workflows/build-zip.yml | 1 + .github/workflows/e2e.yml | 1 + .github/workflows/lint.yml | 1 + .github/workflows/prettier.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/auto-change-prs-branch.yml b/.github/workflows/auto-change-prs-branch.yml index b42be9806..c28768ee8 100644 --- a/.github/workflows/auto-change-prs-branch.yml +++ b/.github/workflows/auto-change-prs-branch.yml @@ -6,6 +6,7 @@ on: - opened - reopened - synchronize + - edited jobs: check-branch: diff --git a/.github/workflows/build-zip.yml b/.github/workflows/build-zip.yml index f7c9e6b18..72708cbf4 100644 --- a/.github/workflows/build-zip.yml +++ b/.github/workflows/build-zip.yml @@ -6,6 +6,7 @@ on: - opened - reopened - synchronize + - edited jobs: build: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 037793570..5dc3c8bbc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -6,6 +6,7 @@ on: - opened - reopened - synchronize + - edited jobs: chrome: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3450e8506..e91ede613 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,7 @@ on: - opened - reopened - synchronize + - edited jobs: eslint: diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index e86fb5ee1..569090bc4 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -6,6 +6,7 @@ on: - opened - reopened - synchronize + - edited jobs: prettier: From 7a3e57c4bb84209bb223d7965161e75fb01a9fb4 Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Wed, 7 May 2025 10:52:10 +0200 Subject: [PATCH 5/8] test (cherry picked from commit 5b673b5fcc7cd1469cbc33bc4a6e3e35f05bf218) --- .../cancel-other-workflows-on-close.yml | 40 +++++++++++++++++++ .github/workflows/greetings.yml | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cancel-other-workflows-on-close.yml diff --git a/.github/workflows/cancel-other-workflows-on-close.yml b/.github/workflows/cancel-other-workflows-on-close.yml new file mode 100644 index 000000000..62662ed5b --- /dev/null +++ b/.github/workflows/cancel-other-workflows-on-close.yml @@ -0,0 +1,40 @@ +name: Cancel PR workflows on close +on: + pull_request: + types: [ closed ] + +jobs: + cancel: + runs-on: ubuntu-latest + permissions: + actions: write + if: ${{ github.event.pull_request.merged == false }} + steps: + - name: Cancel all queued/in_progress workflows for this PR + run: | + owner="${GITHUB_REPOSITORY%%/*}" + repo="${GITHUB_REPOSITORY##*/}" + branch="${{ github.event.pull_request.head.ref }}" + token="${{ secrets.GITHUB_TOKEN }}" + + runs=$(curl -s -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $token" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$owner/$repo/actions/runs?branch=$branch&status=queued" | jq -r '.workflow_runs[].id') + + runs+=" " + runs+=$(curl -s -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $token" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$owner/$repo/actions/runs?branch=$branch&status=in_progress" | jq -r '.workflow_runs[].id') + + for run_id in $runs; do + if [ -n "$run_id" ]; then + echo "Cancelling workflow run: $run_id" + curl -s -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $token" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$owner/$repo/actions/runs/$run_id/cancel" + fi + done diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 5435e78f8..1b793b08c 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: [ pull_request_target, issues ] +on: [ pull_request, issues ] jobs: greeting: From 82827c4961d05ee2ae40eb23749ca47b6dc01764 Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Wed, 7 May 2025 10:54:56 +0200 Subject: [PATCH 6/8] test (cherry picked from commit dbf1633840e47fd1449d3a10f800dba74b2a8c06) --- .github/workflows/cancel-other-workflows-on-close.yml | 2 +- .github/workflows/greetings.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cancel-other-workflows-on-close.yml b/.github/workflows/cancel-other-workflows-on-close.yml index 62662ed5b..42f52be69 100644 --- a/.github/workflows/cancel-other-workflows-on-close.yml +++ b/.github/workflows/cancel-other-workflows-on-close.yml @@ -1,6 +1,6 @@ name: Cancel PR workflows on close on: - pull_request: + pull_request_target: types: [ closed ] jobs: diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 1b793b08c..5435e78f8 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: [ pull_request, issues ] +on: [ pull_request_target, issues ] jobs: greeting: From 4ea1894b4a3d0894a6746cb006284bc8632124b7 Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Wed, 7 May 2025 10:58:43 +0200 Subject: [PATCH 7/8] test --- chrome-extension/manifest.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome-extension/manifest.ts b/chrome-extension/manifest.ts index 954f3461a..f54e48193 100644 --- a/chrome-extension/manifest.ts +++ b/chrome-extension/manifest.ts @@ -74,3 +74,4 @@ const manifest = { } satisfies ManifestType; export default manifest; +console.log('xd'); \ No newline at end of file From 33dd8b17bac4a011925554bc87caf7dcd3997752 Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Wed, 7 May 2025 11:09:57 +0200 Subject: [PATCH 8/8] test --- .github/workflows/auto-change-prs-branch.yml | 10 +- .github/workflows/build-zip.yml | 13 +-- .github/workflows/codeql.yml | 100 +++++++++++++++++++ .github/workflows/e2e.yml | 8 +- .github/workflows/lint.yml | 11 +- .github/workflows/prettier.yml | 8 +- 6 files changed, 108 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/auto-change-prs-branch.yml b/.github/workflows/auto-change-prs-branch.yml index c28768ee8..b7ba9b5db 100644 --- a/.github/workflows/auto-change-prs-branch.yml +++ b/.github/workflows/auto-change-prs-branch.yml @@ -2,11 +2,7 @@ name: Make sure new PRs are sent to development on: pull_request_target: - types: - - opened - - reopened - - synchronize - - edited + types: [ opened ] jobs: check-branch: @@ -23,4 +19,6 @@ jobs: change-to: dev comment: | Your PR's base branch was set to `main`, PRs should be set to target `dev`. - The base branch of this PR has been automatically changed to `dev`, please check that there are no merge conflicts \ No newline at end of file + The base branch of this PR has been automatically changed to `dev`, please check that there are no merge conflicts. + already-exists-action: close_this + already-exists-comment: "Closing, because {url} basing on the same branch" diff --git a/.github/workflows/build-zip.yml b/.github/workflows/build-zip.yml index 72708cbf4..53d5d65cb 100644 --- a/.github/workflows/build-zip.yml +++ b/.github/workflows/build-zip.yml @@ -1,18 +1,10 @@ name: Build And Upload Extension Zip Via Artifact -on: - pull_request_target: - types: - - opened - - reopened - - synchronize - - edited +on: [ pull_request_target ] jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -20,11 +12,8 @@ jobs: with: node-version-file: '.nvmrc' cache: pnpm - - run: pnpm install --frozen-lockfile --prefer-offline - - run: pnpm build - - uses: actions/upload-artifact@v4 with: path: dist/* diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..080632a59 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,100 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main", "dev" ] + pull_request: + branches: [ "main", "dev" ] + schedule: + - cron: '40 18 * * 0' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: javascript-typescript + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # 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 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # 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 + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5dc3c8bbc..4f03b0bb9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,12 +1,6 @@ name: Run E2E Tests -on: - pull_request_target: - types: - - opened - - reopened - - synchronize - - edited +on: [ pull_request_target ] jobs: chrome: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e91ede613..90279d934 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,18 +1,10 @@ name: Lint Check -on: - pull_request_target: - types: - - opened - - reopened - - synchronize - - edited +on: [ pull_request_target ] jobs: eslint: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -22,5 +14,4 @@ jobs: cache: pnpm - run: pnpm install --frozen-lockfile --prefer-offline - - run: pnpm lint diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 569090bc4..d806e22d8 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -1,12 +1,6 @@ name: Formating validation -on: - pull_request_target: - types: - - opened - - reopened - - synchronize - - edited +on: [ pull_request_target ] jobs: prettier: