diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f32b264..13f8cc65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: deno-version: v2.1.3 - name: Generate Stylus import - run: deno task stylus-import + run: deno task ci:stylus-import - name: Upload release artifact run: gh release upload --clobber all-userstyles-export ./dist/import.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 302c52cd..95d8c4cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Bump changed userstyles run: | - git diff --name-only HEAD^1 HEAD | grep '^styles/.*catppuccin\.user\.less$' | xargs deno task bump + git diff --name-only HEAD^1 HEAD | grep '^styles/.*catppuccin\.user\.less$' | xargs deno task ci:bump - name: Commit changes uses: EndBug/add-and-commit@v9 @@ -37,7 +37,7 @@ jobs: push: false - name: Update generated files - run: deno task generate + run: deno task ci:generate env: GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }} diff --git a/.github/workflows/maintainers.yml b/.github/workflows/maintainers.yml index aa3adf55..e0df2a72 100644 --- a/.github/workflows/maintainers.yml +++ b/.github/workflows/maintainers.yml @@ -20,6 +20,6 @@ jobs: deno-version: v2.1.3 - name: Sync maintainers - run: deno task sync-maintainers + run: deno task ci:sync-maintainers env: GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }} diff --git a/deno.json b/deno.json index d16ba6b3..f0fbe860 100644 --- a/deno.json +++ b/deno.json @@ -25,13 +25,14 @@ "usercss-meta": "npm:usercss-meta@0.12.0" }, "tasks": { - "generate": "deno run -A ./scripts/generate/main.ts", - "stylus-import": "deno run -A ./scripts/stylus-import/main.ts", - "sync-maintainers": "deno run -A ./scripts/sync-maintainers/main.ts", + "ci:generate": "deno run -A ./scripts/generate/main.ts", + "ci:stylus-import": "deno run -A ./scripts/stylus-import/main.ts", + "ci:sync-maintainers": "deno run -A ./scripts/sync-maintainers/main.ts", + "ci:update-types": "deno run -A ./scripts/types/update-types.ts", + "ci:bump": "deno run -A ./scripts/bump-version/main.ts", + "lint": "deno run -A ./scripts/lint/main.ts", - "lint:fix": "deno task lint --fix", - "update-types": "deno run -A ./scripts/types/update-types.ts", - "bump": "deno run -A ./scripts/bump-version/main.ts" + "lint:fix": "deno task lint --fix" }, "nodeModulesDir": "auto", "fmt": { diff --git a/scripts/bump-version/main.ts b/scripts/bump-version/main.ts index 5b68001a..7c3b038a 100644 --- a/scripts/bump-version/main.ts +++ b/scripts/bump-version/main.ts @@ -9,7 +9,7 @@ const args = parseArgs(Deno.args, { boolean: ["all"] }); if (!Deno.env.get("CI") && !args.all) { throw new Error( - "This script is intended to be used in CI. Userstyle versions are automatically bumped after pull requests are merged.", + "This script should only be used in CI. Userstyle versions are automatically bumped after pull requests are merged.", ); } diff --git a/scripts/generate/main.ts b/scripts/generate/main.ts index d9ff062c..4195a1af 100755 --- a/scripts/generate/main.ts +++ b/scripts/generate/main.ts @@ -12,6 +12,12 @@ import { getUserstylesTeamMembers, } from "@/utils.ts"; +if (!Deno.env.get("CI")) { + throw new Error( + "This script should only be used in CI. Generated READMEs and other health files are automatically updated after pull requests are merged.", + ); +} + const userstylesData = getUserstylesData(); const portsData = await getPortsData();