-
Notifications
You must be signed in to change notification settings - Fork 0
eslint調整。フロントエンドのgithub actions追加 #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Frontend Quality | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend-quality.yml' | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend-quality.yml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| frontend-quality: | ||
| runs-on: ubuntu-26.04 | ||
| defaults: | ||
| run: | ||
| working-directory: frontend | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'npm' | ||
| cache-dependency-path: frontend/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Lint | ||
| run: npm run lint | ||
|
|
||
| - name: TypeScript check | ||
| run: npm run typecheck | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import test from 'node:test' | ||
| import assert from 'node:assert/strict' | ||
| import { existsSync } from 'node:fs' | ||
|
|
||
| test('frontend entry pages exist', () => { | ||
| assert.equal(existsSync('app/pages/index.vue'), true) | ||
| assert.equal(existsSync('app/pages/health.vue'), true) | ||
| }) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: acaibawl/photo-saas
Length of output: 4976
🌐 Web query:
actions/checkout v4 README persist-credentials default local git config token npm lifecycle scripts💡 Result:
In actions/checkout v4, the persist-credentials input defaults to true [1][2]. When enabled, the action configures the authentication token (or SSH key) into the local git configuration within the workspace [3][4]. This allows subsequent steps in the same job to execute authenticated git commands without additional configuration [3][5]. The token is removed during the post-job cleanup phase [3][6]. Regarding the relationship between these settings and npm lifecycle scripts: 1. Persist-credentials scope: The persist-credentials setting specifically affects git operations by modifying the local.git/config file (e.g., adding an http.https://github.com/.extraheader) [4]. It does not inherently interact with or expose tokens to npm lifecycle scripts unless those scripts explicitly invoke git commands that rely on the credentials stored in the git configuration. 2. Security best practices: While actions/checkout handles git authentication, security risks in npm workflows often involve lifecycle scripts (like preinstall or postinstall) executing arbitrary code [7]. It is a recommended security practice to use the --ignore-scripts flag with npm commands (e.g., npm install --ignore-scripts or npm publish --ignore-scripts) in CI environments to prevent these scripts from executing [7]. 3. Risk mitigation: If you do not need git authentication for downstream steps, you should set persist-credentials: false [4]. This avoids writing the token to the disk, which reduces the surface area for credential exposure (e.g., if the workspace, including the.git directory, is uploaded as an artifact or accessed by malicious scripts) [4].
Citations:
persist-credentials: falseon checkout steps cli/go-gh#225🏁 Script executed:
Repository: acaibawl/photo-saas
Length of output: 3421
actions/checkoutの認証情報を永続化しないでください。actions/checkout@v4は、既定でトークンをローカルの Git 設定に保存します。npm ciはpostinstallなどのライフサイクルスクリプトを実行するため、侵害された依存関係が Git コマンドを実行して読み取り用トークンを取得する可能性があります。後続の手順で認証済み Git 操作はありません。
persist-credentials: falseを設定してください。修正案
- name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 27-28: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools