Skip to content

Commit

Permalink
Fix: trim includes and excludes in the GH action (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauorriols authored Oct 24, 2024
1 parent 75980c2 commit 35381c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ jobs:
if: runner.os == 'Linux' && matrix.deno == 'stable'
run: deno check deployctl.ts

- name: action/deps.js up-to-date
# On Linux the bundle command often segfaults. We use windows as a temporary
# workaround. See https://github.com/denoland/deployctl/issues/338
if: runner.os == 'Windows' && matrix.deno == 'stable'
run: |
# @deno/emit doesn't work if JSR modules are not in the cache.
# This is a workaround to cache the JSR modules beforehand.
deno cache ./src/utils/mod.ts
deno run --allow-read --allow-env --allow-net ./tools/bundle.ts ./src/utils/mod.ts > ./action/latest.deps.js
diff ./action/latest.deps.js ./action/deps.js
# Skip temporarily (see https://github.com/denoland/deployctl/actions/runs/11500790181/job/32011870448?pr=342#step:8:148)
# - name: action/deps.js up-to-date
# if: runner.os == 'Linux' && matrix.deno == 'stable'
# run: |
# # @deno/emit doesn't work if JSR modules are not in the cache.
# # This is a workaround to cache the JSR modules beforehand.
# deno cache ./src/utils/mod.ts
# deno run --allow-read --allow-env --allow-net ./tools/bundle.ts ./src/utils/mod.ts > ./action/latest.deps.js
# diff ./action/latest.deps.js ./action/deps.js

- name: Run tests
# Deno 1.x does not support lockfile v4. To work around this, we append
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
project: happy-rat-64
root: action
entrypoint: tests/include_exclude.ts
include: foo,tests/include_exclude.ts,bar
include: foo, tests/include_exclude.ts,bar
- name: Deploy with comma-separated exclude
uses: ./
with:
Expand Down
4 changes: 2 additions & 2 deletions action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ async function main() {
}

core.debug(`Discovering assets in "${cwd}"`);
const includes = include.flatMap((i) => i.split(","));
const excludes = exclude.flatMap((e) => e.split(","));
const includes = include.flatMap((i) => i.split(",")).map((i) => i.trim());
const excludes = exclude.flatMap((e) => e.split(",")).map((i) => i.trim());
// Exclude node_modules by default unless explicitly specified
if (!includes.some((i) => i.includes("node_modules"))) {
excludes.push("**/node_modules");
Expand Down

0 comments on commit 35381c7

Please sign in to comment.