From c20142e6f9f7d2eadf5476d4532a7934b4ba53cf Mon Sep 17 00:00:00 2001 From: Anastasiia Ivanchenko Date: Sun, 7 Jun 2026 17:20:59 +0300 Subject: [PATCH] Fix failing pipelines by removing invalid branch protection workflow. GitHub Actions does not support administration permissions in workflow YAML, and Dependabot ESLint 10 upgrades break eslint-config-next until that combo is supported. Co-authored-by: Cursor --- .github/dependabot.yml | 3 + .github/workflows/branch-protection.yml | 97 ------------------------- package.json | 2 +- 3 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 .github/workflows/branch-protection.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d93c064..d88bf22 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,6 +15,9 @@ updates: - "react-dom" dev-dependencies: dependency-type: development + ignore: + - dependency-name: eslint + update-types: ["version-update:semver-major"] - package-ecosystem: github-actions directory: / diff --git a/.github/workflows/branch-protection.yml b/.github/workflows/branch-protection.yml deleted file mode 100644 index 2dd6601..0000000 --- a/.github/workflows/branch-protection.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Branch protection - -on: - push: - branches: - - main - paths: - - .github/workflows/branch-protection.yml - workflow_dispatch: - -permissions: - administration: write - -jobs: - apply-ruleset: - name: Apply main branch ruleset - runs-on: ubuntu-latest - steps: - - name: Sync branch protection ruleset - uses: actions/github-script@v7 - with: - script: | - const RULESET_NAME = "Protect main"; - const REQUIRED_CHECKS = ["Lint and build"]; - - const { owner, repo } = context.repo; - - const rulesetPayload = { - name: RULESET_NAME, - target: "branch", - enforcement: "active", - conditions: { - ref_name: { - include: ["~DEFAULT_BRANCH"], - exclude: [], - }, - }, - rules: [ - { - type: "pull_request", - parameters: { - required_approving_review_count: 0, - dismiss_stale_reviews_on_push: false, - require_code_owner_review: false, - require_last_push_approval: false, - required_review_thread_resolution: false, - }, - }, - { type: "deletion" }, - { type: "non_fast_forward" }, - { - type: "required_status_checks", - parameters: { - strict_required_status_checks_policy: true, - do_not_enforce_on_create: false, - required_status_checks: REQUIRED_CHECKS.map((context) => ({ - context, - })), - }, - }, - ], - }; - - const { data: rulesets } = await github.request( - "GET /repos/{owner}/{repo}/rulesets", - { - owner, - repo, - headers: { "X-GitHub-Api-Version": "2022-11-28" }, - }, - ); - - const existing = rulesets.find((ruleset) => ruleset.name === RULESET_NAME); - - if (existing) { - await github.request("PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}", { - owner, - repo, - ruleset_id: existing.id, - ...rulesetPayload, - headers: { "X-GitHub-Api-Version": "2022-11-28" }, - }); - core.info(`Updated ruleset "${RULESET_NAME}" (id: ${existing.id}).`); - return; - } - - const { data: created } = await github.request( - "POST /repos/{owner}/{repo}/rulesets", - { - owner, - repo, - ...rulesetPayload, - headers: { "X-GitHub-Api-Version": "2022-11-28" }, - }, - ); - - core.info(`Created ruleset "${RULESET_NAME}" (id: ${created.id}).`); diff --git a/package.json b/package.json index f2e088d..1f9629a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "eslint": "^9", + "eslint": "^9.0.0", "eslint-config-next": "16.2.6", "tailwindcss": "^4", "typescript": "^5"