Skip to content

Commit

Permalink
feat: clarify intended usage of deno tasks/scripts (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter authored Jan 22, 2025
1 parent bc3dd70 commit c9bc550
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maintainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
13 changes: 7 additions & 6 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"usercss-meta": "npm:[email protected]"
},
"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": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/bump-version/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
);
}

Expand Down
6 changes: 6 additions & 0 deletions scripts/generate/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c9bc550

Please sign in to comment.