Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ff8e80

Browse filesBrowse files
authored
ci: use yarn workspace for workflow dependencies (#48246)
1 parent 20c7042 commit 1ff8e80
Copy full SHA for 1ff8e80

File tree

Expand file treeCollapse file tree

6 files changed

+549
-14
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+549
-14
lines changed
Open diff view settings
Collapse file

‎.github/workflows/audit-branch-ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/audit-branch-ci.yml
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@ jobs:
1919
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2020
with:
2121
node-version: 22.17.x
22-
- run: npm install @actions/cache@4.0.3 @electron/fiddle-core@2.0.1
22+
- name: Sparse checkout repository
23+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
24+
with:
25+
sparse-checkout: |
26+
.
27+
.github
28+
.yarn
29+
- run: yarn workspaces focus @electron/gha-workflows
2330
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
2431
id: audit-errors
2532
with:
2633
github-token: ${{ secrets.GITHUB_TOKEN }}
2734
script: |
35+
const { chdir } = require('node:process');
36+
chdir('${{ github.workspace }}/.github/workflows');
37+
2838
const cache = require('@actions/cache');
2939
const { ElectronVersions } = require('@electron/fiddle-core');
3040
Collapse file

‎.github/workflows/issue-opened.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/issue-opened.yml
+14-4Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ jobs:
3737
with:
3838
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
3939
org: electron
40-
- run: npm install @electron/fiddle-core@1.3.3 mdast-util-from-markdown@2.0.0 unist-util-select@5.1.0 semver@7.6.0
40+
- name: Sparse checkout repository
41+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
42+
with:
43+
sparse-checkout: |
44+
.
45+
.github
46+
.yarn
47+
- run: yarn workspaces focus @electron/gha-workflows
4148
- name: Add labels
4249
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
4350
id: add-labels
@@ -46,9 +53,12 @@ jobs:
4653
with:
4754
github-token: ${{ steps.generate-token.outputs.token }}
4855
script: |
49-
const { fromMarkdown } = await import('${{ github.workspace }}/node_modules/mdast-util-from-markdown/index.js');
50-
const { select } = await import('${{ github.workspace }}/node_modules/unist-util-select/index.js');
51-
const semver = await import('${{ github.workspace }}/node_modules/semver/index.js');
56+
const { chdir } = require('node:process');
57+
chdir('${{ github.workspace }}/.github/workflows');
58+
59+
const { fromMarkdown } = require('mdast-util-from-markdown');
60+
const { select } = require('unist-util-select');
61+
const semver = require('semver');
5262
5363
const [ owner, repo ] = '${{ github.repository }}'.split('/');
5464
const issue_number = ${{ github.event.issue.number }};
Collapse file

‎.github/workflows/package.json‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@electron/gha-workflows",
3+
"version": "0.0.0-development",
4+
"private": true,
5+
"type": "module",
6+
"dependencies": {
7+
"@actions/cache": "^4.0.3",
8+
"@electron/fiddle-core": "^2.0.1",
9+
"mdast-util-from-markdown": "^2.0.0",
10+
"semver": "^7.7.2",
11+
"unist-util-select": "^5.1.0"
12+
}
13+
}
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
},
143143
"packageManager": "yarn@4.11.0",
144144
"workspaces": [
145+
".github/workflows",
145146
"spec",
146147
"spec/fixtures/native-addon/*"
147148
],
Collapse file

‎script/lint.js‎

Copy file name to clipboardExpand all lines: script/lint.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const LINTERS = [{
153153
}, {
154154
key: 'javascript',
155155
roots: ['build', 'default_app', 'lib', 'npm', 'script', 'spec'],
156-
ignoreRoots: ['spec/node_modules', 'spec/fixtures/native-addon'],
156+
ignoreRoots: ['.github/workflows/node_modules', 'spec/node_modules', 'spec/fixtures/native-addon'],
157157
test: filename => filename.endsWith('.js') || filename.endsWith('.ts') || filename.endsWith('.mjs'),
158158
run: async (opts, filenames) => {
159159
const eslint = new ESLint({
@@ -282,7 +282,7 @@ const LINTERS = [{
282282
}, {
283283
key: 'md',
284284
roots: ['.'],
285-
ignoreRoots: ['.git', 'node_modules', 'spec/node_modules', 'spec/fixtures/native-addon'],
285+
ignoreRoots: ['.git', '.github/workflows/node_modules', 'node_modules', 'spec/node_modules', 'spec/fixtures/native-addon'],
286286
test: filename => filename.endsWith('.md'),
287287
run: async (opts, filenames) => {
288288
const { getCodeBlocks } = await import('@electron/lint-roller/dist/lib/markdown.js');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.