-
-
Notifications
You must be signed in to change notification settings - Fork 875
Add Deno workflow for linting and testing #4259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| # This workflow will install Deno then run `deno lint` and `deno test`. | ||
| # For more information see: https://github.com/denoland/setup-deno | ||
|
|
||
| name: Deno | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["master"] | ||
| pull_request: | ||
| branches: ["master"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Setup repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Deno | ||
| # uses: denoland/setup-deno@v1 | ||
| uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 # v1.1.2 | ||
| with: | ||
| deno-version: v1.x | ||
|
|
||
| # Uncomment this step to verify the use of 'deno fmt' on each commit. | ||
| # - name: Verify formatting | ||
| # run: deno fmt --check | ||
|
|
||
| - name: Run linter | ||
| run: deno lint | ||
|
|
||
| - name: Run tests | ||
| run: deno test -A | ||
|
Comment on lines
+38
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "Deno configuration and version files:"
fd -HI -t f \
-g 'deno.json' \
-g 'deno.jsonc' \
-g 'deno.lock' \
-g '.dvmrc' \
-g '.tool-versions' . || true
echo "Deno test candidates:"
rg --files -g '!node_modules/**' -g '!dist/**' |
rg '(^|/)(__tests__/|.*(_test|\.test)\.(ts|tsx|mts|js|mjs|jsx)$)' || true
echo "Declared package scripts:"
rg -n '"(scripts|lint|test|build)"|eslint|jest|vite' package.jsonRepository: TeamPiped/Piped Length of output: 1162 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Relevant files:"
git ls-files | sed -n '1,220p' | rg '(^|/)(deno\.jsonc?$|package\.json$|.*test\.(ts|tsx|js|jsx|mjs|mts)$|.*(_test).*\.(ts|tsx|js|jsx|mjs|mts)$|__tests__/.*\.(ts|tsx|js|jsx|mjs|mts)|\.github/workflows/deno\.yml$)' || true
echo
echo ".github/workflows/deno.yml:"
if [ -f .github/workflows/deno.yml ]; then
cat -n .github/workflows/deno.yml
else
echo "missing"
fi
echo
echo "package.json scripts:"
python3 - <<'PY'
import json
from pathlib import Path
p=Path('package.json')
if not p.exists():
print('missing')
else:
data=json.loads(p.read_text())
print(json.dumps(data.get('scripts', {}), indent=2, sort_keys=True))
PY
echo
echo "Potential Deno commands/config references:"
rg --hidden --glob '!node_modules/**' --glob '!dist/**' --glob '!coverage/**' '(deno\.jsonc?$|DENO|deno lint|deno test|deno run|deno cache|deno fmt)' || trueRepository: TeamPiped/Piped Length of output: 1786 Run the repository’s declared checks instead of Deno-only commands.
🤖 Prompt for AI Agents
Comment on lines
+41
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '--- workflow excerpt ---\n'
if [ -f .github/workflows/deno.yml ]; then
nl -ba .github/workflows/deno.yml | sed -n '1,140p'
else
echo ".github/workflows/deno.yml not found"
fi
printf '\n--- test commands using deno test / permissions ---\n'
rg -n "deno test|allow-" .github deno.json deno.jsonc src test tests scripts 2>/dev/null || true
printf '\n--- tracked relevant files ---\n'
git ls-files | sed -n '1,200p' | grep -E '(^\.github/workflows/deno\.yml$|deno\.(json|jsonc)|test|tests)' || trueRepository: TeamPiped/Piped Length of output: 244 🏁 Script executed: #!/bin/bash
set -euo pipefail
cat -n .github/workflows/deno.yml | sed -n '1,140p'
printf '\n--- test commands using deno test / permissions ---\n'
rg -n "deno test|allow-" .github deno.json deno.jsonc src test tests scripts 2>/dev/null || true
printf '\n--- tracked relevant files ---\n'
git ls-files | grep -E '(^\.github/workflows/deno\.yml$|deno\.(json|jsonc)|test|tests)' || trueRepository: TeamPiped/Piped Length of output: 1721 Remove blanket permissions from pull-request tests.
🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: TeamPiped/Piped
Length of output: 244
🏁 Script executed:
Repository: TeamPiped/Piped
Length of output: 2144
🌐 Web query:
actions/checkout v4 README persist-credentials default true💡 Result:
In the
actions/checkoutv4 action, thepersist-credentialsinput defaults totrue[1][2]. When set totrue(the default), the action configures the authentication token or SSH key in the local git configuration [3][4]. This allows subsequent git commands executed within your workflow steps to use these credentials automatically [3][5]. The token is removed during the post-job cleanup process [3][4]. If you wish to prevent this behavior for security reasons or because it is not needed, you can explicitly setpersist-credentialstofalsein your workflow configuration [3][4]. Example usage: - uses: actions/checkout@v4 with: persist-credentials: falseCitations:
Disable checkout credential persistence.
actions/checkout@v4persists the GitHub token in local Git configuration by default. The laterdeno test -Astep runs PR-controlled code that can read.git/configand exfiltrate the read-only token. Setpersist-credentials: false, since this job has no authenticated Git operations after checkout.🔒 Proposed fix
- name: Setup repo uses: actions/checkout@v4 + with: + persist-credentials: false📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 25-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools