Compare commits

...

83 Commits

Author SHA1 Message Date
Cameron Booth 5dbaa884db Merge pull request #69 from actions/release/0.3.9
Release version 0.3.9
2024-03-05 15:38:41 -08:00
GitHub Actions 67d9f06795 Release extension version 0.3.9 2024-03-05 23:34:14 +00:00
Cameron Booth dec1281c4c Merge pull request #67 from actions/dependabot/npm_and_yarn/ip-2.0.1
Bump ip from 2.0.0 to 2.0.1
2024-03-05 12:17:34 -08:00
dependabot[bot] 4d64772250 Bump ip from 2.0.0 to 2.0.1
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 20:08:45 +00:00
Cameron Booth b200bedbce Merge pull request #66 from actions/dependabot/npm_and_yarn/axios-1.6.7
Bump axios from 1.1.3 to 1.6.7
2024-03-05 12:03:04 -08:00
dependabot[bot] 62cf97a1fd Bump axios from 1.1.3 to 1.6.7
Bumps [axios](https://github.com/axios/axios) from 1.1.3 to 1.6.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.1.3...v1.6.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 19:56:11 +00:00
Cameron Booth c9aeb8d597 Merge pull request #68 from actions/dependabot/npm_and_yarn/follow-redirects-1.15.5
Bump follow-redirects from 1.15.2 to 1.15.5
2024-03-04 16:34:50 -08:00
dependabot[bot] 26d8080e56 Bump follow-redirects from 1.15.2 to 1.15.5
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.5.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.5)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 00:30:38 +00:00
Cameron Booth a1d07a6ffe Merge pull request #61 from actions/dependabot/npm_and_yarn/babel/traverse-7.23.2
Bump @babel/traverse from 7.20.1 to 7.23.2
2024-03-04 16:28:51 -08:00
dependabot[bot] e6ce85f61f Bump @babel/traverse from 7.20.1 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.1 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-18 14:54:48 +00:00
Crystal Tenn 4280a967a8 Merge pull request #58 from actions/release/0.3.8
Release version 0.3.8
2023-09-06 11:49:24 -04:00
GitHub Actions ded93b55e7 Release extension version 0.3.8 2023-09-06 15:44:25 +00:00
Crystal Tenn f966106367 Merge pull request #49 from actions/dependabot/npm_and_yarn/word-wrap-1.2.4
Bump word-wrap from 1.2.3 to 1.2.4
2023-09-06 11:15:46 -04:00
Crystal Tenn aaa71be634 Merge pull request #57 from muzimuzhi/github-context
Update `github` context properties
2023-09-06 11:15:06 -04:00
Yukai Chou 818a321069 Fix typo in url 2023-08-31 02:39:28 +08:00
Yukai Chou c4d2f35a55 Update github context properties 2023-08-31 02:36:50 +08:00
Jonathan Tamsut 6513b0d15d Merge pull request #55 from actions/release/0.3.7
Release version 0.3.7
2023-08-04 12:55:35 -07:00
GitHub Actions 207cfa12c0 Release extension version 0.3.7 2023-08-04 19:54:21 +00:00
Jonathan Tamsut 28ab3928fd Merge pull request #52 from actions/fix-indentation-completion
Correctly indent completion options
2023-08-04 12:20:50 -07:00
Jonathan Tamsut afbe42bffe fix test failures 2023-08-04 12:13:21 -07:00
Christopher Schleiden a324b8b9dc small tweaks 2023-08-04 11:32:10 -07:00
Christopher Schleiden 4f7d03ed0c Correctly indent completion options 2023-08-04 11:19:42 -07:00
dependabot[bot] 78acb30a9c Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 06:59:20 +00:00
Crystal Tenn 4ddbbc9db7 Merge pull request #28 from actions/dependabot/npm_and_yarn/yaml-2.2.2
Bump yaml from 2.1.3 to 2.2.2
2023-07-12 17:23:42 -04:00
Crystal Tenn 3ea2cf1829 Merge branch 'main' into dependabot/npm_and_yarn/yaml-2.2.2 2023-07-12 16:48:53 -04:00
Crystal Tenn 2c30f2f45f Merge pull request #47 from muzimuzhi/typo
Fix typos in workflow schema
2023-07-12 16:48:25 -04:00
Yukai Chou cf2d9cd0b9 Fix typos in workflow schema 2023-07-07 16:25:08 +08:00
Felipe Suero 8f2f59092e Merge pull request #46 from actions/release/0.3.6
Release version 0.3.6
2023-06-14 14:57:51 -04:00
GitHub Actions 5de89b0f8e Release extension version 0.3.6 2023-06-14 17:21:25 +00:00
Felipe Suero f4afa48ea4 Merge pull request #45 from actions/lerna-config-p2
Lerna config p2
2023-06-14 13:13:13 -04:00
Felipe Suero af5dd4b91e update gitignore 2023-06-14 12:43:13 -04:00
Felipe Suero 12d28370dc Explicitly state packages to upgrade 2023-06-14 12:42:49 -04:00
Felipe Suero 833b6fcac5 Explicitly state packages to upgrade 2023-06-14 12:42:36 -04:00
Felipe Suero cd7fabeb7f Merge pull request #44 from actions/felipesu19-patch-1
Update lerna.json
2023-06-14 12:03:35 -04:00
Felipe Suero 26da52bdf8 Update lerna.json
The current version of lerna doesn't use useWorkspaces anymore, defaulting to using the workspace config if one exists: 

```
ECONFIGWORKSPACES The "useWorkspaces" option has been removed. By default lerna will resolve your packages using your package manager's workspaces configuration. Alternatively, you can manually provide a list of package globs to be used instead via the "packages" option in lerna.json.
```
2023-06-14 11:28:36 -04:00
Felipe Suero 31aa95fb10 Merge pull request #43 from Olfi01/main
[languageserver] Enable support for GitHub Enterprise Server
2023-06-13 10:16:54 -04:00
Olfi01 b912482163 Apply suggestions from code review
Changed parameter naming to match general pattern

Co-authored-by: Christopher Schleiden <cschleiden@live.de>
2023-05-25 00:57:30 +02:00
flmeyer 41436c6570 Use correct RequestError class 2023-05-19 16:34:58 +02:00
flmeyer 468b68840b Add try-catch to avoid failing requests
On GHES servers below version 3.8, the variables context is unavailable, resulting in 404 errors when calling the corresponding endpoint.
2023-05-12 22:42:09 +02:00
flmeyer 57a77551b0 Enable support for GitHub Enterprise Server 2023-05-08 17:00:05 +02:00
dependabot[bot] a34a500176 Bump yaml from 2.1.3 to 2.2.2
Bumps [yaml](https://github.com/eemeli/yaml) from 2.1.3 to 2.2.2.
- [Release notes](https://github.com/eemeli/yaml/releases)
- [Commits](https://github.com/eemeli/yaml/compare/v2.1.3...v2.2.2)

---
updated-dependencies:
- dependency-name: yaml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-05 17:48:24 +00:00
Felipe Suero d7ae6f88f1 Merge pull request #42 from actions/release/0.3.5
Release version 0.3.5
2023-05-05 13:47:40 -04:00
Felipe Suero 588c457cea Merge branch 'main' into release/0.3.5 2023-05-05 13:41:13 -04:00
Felipe Suero 82985934af Merge pull request #41 from actions/auto-generate-notes
correct bash script
2023-05-05 13:40:46 -04:00
GitHub Actions cb3ec583e0 Release extension version 0.3.5 2023-05-05 17:40:07 +00:00
Felipe Suero 7c3b116b19 correct bash script 2023-05-05 13:38:29 -04:00
Crystal Tenn 4a6134be6c Merge pull request #39 from activescott/patch-1
docs: fix WorkflowTemplate file link in readme
2023-05-03 14:56:25 -04:00
Felipe Suero 0080226132 Merge pull request #34 from actions/auto-generate-notes
add script
2023-05-03 14:51:53 -04:00
scott willeke 896f780991 docs: fix WorkflowTemplate file link in readme 2023-05-03 11:44:14 -07:00
Felipe Suero 63b170f2a6 Merge pull request #27 from actions/secrets-v2
Remove Secret Errors for dynamic environments
2023-05-03 14:20:33 -04:00
Felipe Suero 94451fa8f2 nits 2023-05-02 14:57:24 -04:00
Felipe Suero 41e05b8ad1 address nits 2023-05-02 14:54:11 -04:00
Felipe Suero 5362fb1841 its important to target the right repo 2023-05-02 13:11:55 -04:00
Felipe Suero 4e1f7cd9ac its important to target the right repo 2023-05-02 13:11:19 -04:00
Felipe Suero 5c785ab41b merge main in, port changes 2023-05-02 13:05:17 -04:00
Felipe Suero 9d246960f3 Merge branch 'main' of github.com:actions/languageservices into auto-generate-notes 2023-05-02 13:02:57 -04:00
Felipe Suero eefd820cc5 prettify 2023-05-02 11:50:51 -04:00
Felipe Suero 58712f4d46 prettify 2023-05-02 11:43:07 -04:00
Felipe Suero 0bd67083ff add comments 2023-05-02 11:23:48 -04:00
Felipe Suero 40c20d5504 handle the edge-cases 2023-05-02 11:22:00 -04:00
Felipe Suero c6cde72b37 Merge pull request #32 from actions/major-minor-choices
Automate incrementing the version number
2023-05-01 10:32:20 -04:00
Felipe Suero d47636092a don't pin actions stuff 2023-05-01 10:15:24 -04:00
Felipe Suero e292f8ca51 pin all the things 2023-05-01 10:10:52 -04:00
Felipe Suero 8f4080074b pin dependencies 2023-05-01 10:05:19 -04:00
Felipe Suero b04e5db100 save files 2023-04-28 12:55:00 -04:00
Felipe Suero 2795997f4c minor fixes 2023-04-28 12:53:31 -04:00
Felipe Suero 413ae51185 add script 2023-04-27 13:03:45 -04:00
Felipe Suero 8bc0c5636e draw from lerna 2023-04-27 10:28:01 -04:00
Felipe Suero 58bf3b35cc chmod 2023-04-27 10:25:40 -04:00
Felipe Suero 124ee84d1f Automate incrementing the version number 2023-04-27 10:23:36 -04:00
Felipe Suero c4d478d459 commiting instead of stashing 2023-04-26 11:57:08 -04:00
Felipe Suero 9945ec321b why does this not work? 2023-04-25 10:00:29 -04:00
Jonathan Tamsut 5cb4007629 Merge pull request #26 from actions/release/0.3.4
Release version 0.3.4
2023-04-21 11:10:29 -07:00
GitHub Actions 07fa29649e Release extension version 0.3.4 2023-04-21 18:09:23 +00:00
Liela Rotschy 7bb2962bb0 Merge pull request #25 from actions/lrotschy/add-branches-ignore-to-merge-group-schema
Add branches-ignore to merge group schema
2023-04-19 14:38:04 -06:00
Liela Rotschy 3904c64796 Alphabetize 2023-04-19 13:15:08 -06:00
Liela Rotschy 48ad5e5251 Fix indentation 2023-04-19 13:11:39 -06:00
Liela Rotschy 317c4fcd63 Fix hyphen 2023-04-19 12:58:00 -06:00
Liela Rotschy bf97052855 Add branches-ignore to merge group schema 2023-04-19 12:29:38 -06:00
Crystal Tenn dd8930fd74 Merge pull request #24 from actions/ketchup/fixReusableWorkflowRef
Fix Reusable Workflow Reference for Windows by using vscodeURI instead of path.join
2023-04-19 11:07:04 -04:00
Crystal Tenn 2449e5cea1 make variable names more specific 2023-04-18 18:16:55 -04:00
Crystal Tenn dba3cf5d96 remove unused reference to path 2023-04-18 18:13:52 -04:00
Crystal Tenn 804f83828f fix path reference for reusable workflows and use vscodeURI instead 2023-04-18 17:30:53 -04:00
24 changed files with 429 additions and 160 deletions
+20 -9
View File
@@ -1,13 +1,18 @@
name: Create release PR
run-name: Create release PR for v${{ github.event.inputs.version }}
run-name: Create release PR for new ${{ github.event.inputs.version }} version
on:
workflow_dispatch:
inputs:
version:
required: true
description: "Version to bump `package.json` to (format: x.y.z)"
type: choice
description: "What type of release is this"
options:
- "major"
- "minor"
- "patch"
jobs:
create-release-pr:
@@ -31,21 +36,27 @@ jobs:
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"
git checkout -b release/${{ inputs.version }}
NEW_VERSION=$(./script/workflows/increment-version.sh ${{ inputs.version }})
npx lerna version ${{ inputs.version }} --yes --no-push --no-git-tag-version --force-publish
git checkout -b release/$NEW_VERSION
npx lerna version $NEW_VERSION --yes --no-push --no-git-tag-version --force-publish
git add **/package.json package-lock.json lerna.json
git commit -m "Release extension version ${{ inputs.version }}"
git commit -m "Release extension version $NEW_VERSION"
git push --set-upstream origin release/${{ inputs.version }}
git push --set-upstream origin release/$NEW_VERSION
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Create PR
run: |
LAST_PR=$(gh pr list --repo ${{ github.repository }} --limit 1 --state merged --search "Release version" --json number | jq -r '.[0].number')
./script/workflows/generate-release-notes.sh $LAST_PR ${{ env.new_version }}
gh pr create \
--title "Release version ${{ inputs.version }}" \
--body "Release version ${{ inputs.version }}" \
--title "Release version ${{ env.new_version }}" \
--body-file releasenotes.md \
--base main \
--head release/${{ inputs.version }}
--head release/${{ env.new_version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -1,5 +1,5 @@
*/node_modules
*/dist
lerna-debug.log
node_modules
.DS_Store
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/expressions",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"type": "module",
"source": "./src/index.ts",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/languageserver",
"version": "0.3.3",
"version": "0.3.9",
"description": "Language server for GitHub Actions",
"license": "MIT",
"type": "module",
@@ -43,8 +43,8 @@
"watch": "tsc --build tsconfig.build.json --watch"
},
"dependencies": {
"@actions/languageservice": "^0.3.3",
"@actions/workflow-parser": "^0.3.3",
"@actions/languageservice": "^0.3.9",
"@actions/workflow-parser": "^0.3.9",
"@octokit/rest": "^19.0.7",
"@octokit/types": "^9.0.0",
"vscode-languageserver": "^8.0.2",
+3 -2
View File
@@ -1,8 +1,9 @@
import {Octokit} from "@octokit/rest";
export function getClient(token: string, userAgent?: string): Octokit {
export function getClient(token: string, userAgent?: string, apiUrl?: string): Octokit {
return new Octokit({
auth: token,
userAgent: userAgent || `GitHub Actions Language Server`
userAgent: userAgent || `GitHub Actions Language Server`,
baseUrl: apiUrl
});
}
+1 -1
View File
@@ -51,7 +51,7 @@ export function initConnection(connection: Connection) {
const options = params.initializationOptions as InitializationOptions;
if (options.sessionToken) {
client = getClient(options.sessionToken, options.userAgent);
client = getClient(options.sessionToken, options.userAgent, options.gitHubApiUrl);
}
if (options.repos) {
@@ -28,6 +28,7 @@ export async function getSecrets(
}
const eventsConfig = workflowContext?.template?.events;
if (eventsConfig?.workflow_call) {
// Unpredictable secrets may be passed in via a workflow_call trigger
secretsContext.complete = false;
@@ -38,6 +39,7 @@ export async function getSecrets(
}
let environmentName: string | undefined;
if (workflowContext?.job?.environment) {
if (isString(workflowContext.job.environment)) {
environmentName = workflowContext.job.environment.value;
@@ -46,10 +48,17 @@ export async function getSecrets(
if (isString(x.key) && x.key.value === "name") {
if (isString(x.value)) {
environmentName = x.value.value;
} else {
// this means we have a dynamic enviornment, in those situations we
// want to make sure we skip doing secret validation
secretsContext.complete = false;
}
break;
}
}
} else {
// if the expression is something like environment: ${{ ... }} then we want to skip validation
secretsContext.complete = false;
}
}
@@ -2,9 +2,10 @@ import {data, DescriptionDictionary} from "@actions/expressions";
import {Pair} from "@actions/expressions/data/expressiondata";
import {StringData} from "@actions/expressions/data/index";
import {WorkflowContext} from "@actions/languageservice/context/workflow-context";
import {warn} from "@actions/languageservice/log";
import {log, warn} from "@actions/languageservice/log";
import {isMapping, isString} from "@actions/workflow-parser";
import {Octokit} from "@octokit/rest";
import {RequestError} from "@octokit/request-error";
import {RepositoryContext} from "../initializationOptions";
import {TTLCache} from "../utils/cache";
@@ -42,50 +43,58 @@ export async function getVariables(
}
const variablesContext = defaultContext || new DescriptionDictionary();
const variables = await getRemoteVariables(octokit, cache, repo, environmentName);
try {
const variables = await getRemoteVariables(octokit, cache, repo, environmentName);
// Build combined map of variables
const variablesMap = new Map<
string,
{
key: string;
value: data.StringData;
description?: string;
}
>();
// Build combined map of variables
const variablesMap = new Map<
string,
{
key: string;
value: data.StringData;
description?: string;
}
>();
variables.organizationVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Organization variable`
})
);
variables.organizationVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Organization variable`
})
);
// Override org variables with repo variables
variables.repoVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Repository variable`
})
);
// Override org variables with repo variables
variables.repoVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Repository variable`
})
);
// Override repo variables with environment veriables (if defined)
variables.environmentVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Variable for environment \`${environmentName || ""}\``
})
);
// Override repo variables with environment veriables (if defined)
variables.environmentVariables.forEach(variable =>
variablesMap.set(variable.key.toLowerCase(), {
key: variable.key,
value: new data.StringData(variable.value.coerceString()),
description: `${variable.value.coerceString()} - Variable for environment \`${environmentName || ""}\``
})
);
// Sort variables by key and add to context
Array.from(variablesMap.values())
.sort((a, b) => a.key.localeCompare(b.key))
.forEach(variable => variablesContext?.add(variable.key, variable.value, variable.description));
// Sort variables by key and add to context
Array.from(variablesMap.values())
.sort((a, b) => a.key.localeCompare(b.key))
.forEach(variable => variablesContext?.add(variable.key, variable.value, variable.description));
return variablesContext;
return variablesContext;
} catch (e) {
if (!(e instanceof RequestError)) throw e;
if (e.name == "HttpError" && e.status == 404) {
log("Failure to request variables. Ignore if you're using GitHub Enterprise Server below version 3.8");
return variablesContext;
} else throw e;
}
}
export async function getRemoteVariables(
+5 -2
View File
@@ -2,8 +2,8 @@ import {File} from "@actions/workflow-parser/workflows/file";
import {FileProvider} from "@actions/workflow-parser/workflows/file-provider";
import {fileIdentifier} from "@actions/workflow-parser/workflows/file-reference";
import {Octokit} from "@octokit/rest";
import path from "path";
import {TTLCache} from "./utils/cache";
import vscodeURI from "vscode-uri/lib/umd";
export function getFileProvider(
client: Octokit | undefined,
@@ -31,7 +31,10 @@ export function getFileProvider(
throw new Error("Local file references are not supported with this configuration");
}
const file = await readFile(path.join(workspace, ref.path));
const workspaceURI = vscodeURI.URI.parse(workspace);
const refURI = vscodeURI.Utils.joinPath(workspaceURI, ref.path);
const file = await readFile(refURI.toString());
if (!file) {
throw new Error(`File not found: ${ref.path}`);
}
@@ -23,6 +23,11 @@ export interface InitializationOptions {
* Desired log level
*/
logLevel?: LogLevel;
/**
* If a GitHub Enterprise Server should be used, the URL of the API endpoint, eg "https://ghe.my-company.com/api/v3"
*/
gitHubApiUrl?: string;
}
export interface RepositoryContext {
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/languageservice",
"version": "0.3.3",
"version": "0.3.9",
"description": "Language service for GitHub Actions",
"license": "MIT",
"type": "module",
@@ -44,8 +44,8 @@
"watch": "tsc --build tsconfig.build.json --watch"
},
"dependencies": {
"@actions/expressions": "^0.3.3",
"@actions/workflow-parser": "^0.3.3",
"@actions/expressions": "^0.3.9",
"@actions/workflow-parser": "^0.3.9",
"vscode-languageserver-textdocument": "^1.0.7",
"vscode-languageserver-types": "^3.17.2",
"vscode-uri": "^3.0.7",
+38 -6
View File
@@ -4,8 +4,8 @@ import {complete} from "./complete";
import {registerLogger} from "./log";
import {getPositionFromCursor} from "./test-utils/cursor-position";
import {TestLogger} from "./test-utils/logger";
import {ValueProviderConfig, ValueProviderKind} from "./value-providers/config";
import {clearCache} from "./utils/workflow-cache";
import {ValueProviderConfig, ValueProviderKind} from "./value-providers/config";
registerLogger(new TestLogger());
@@ -406,7 +406,7 @@ jobs:
expect(result.map(e => e.label)).toContain("runs-on");
const textEdit = result.filter(e => e.label === "runs-on")[0].textEdit as TextEdit;
expect(textEdit.newText).toEqual("runs-on");
expect(textEdit.newText).toEqual("runs-on: ");
expect(textEdit.range).toEqual({
start: {line: 3, character: 4},
end: {line: 3, character: 10}
@@ -421,7 +421,7 @@ jobs:
expect(result.map(e => e.label)).toContain("runs-on");
const textEdit = result.filter(e => e.label === "runs-on")[0].textEdit as TextEdit;
expect(textEdit.newText).toEqual("runs-on");
expect(textEdit.newText).toEqual("runs-on: ");
expect(textEdit.range).toEqual({
start: {line: 3, character: 4},
end: {line: 3, character: 4}
@@ -448,7 +448,7 @@ jobs:
]);
// One-of
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency"]);
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency: "]);
});
it("custom indentation", async () => {
@@ -471,11 +471,11 @@ jobs:
]);
// One-of
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency"]);
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency: "]);
});
});
it("adds a new line and indentation for mapping keys", async () => {
it("adds a new line and indentation for mapping keys when the key is given", async () => {
const input = "concurrency: |";
const result = await complete(...getPositionFromCursor(input));
@@ -485,4 +485,36 @@ jobs:
]);
expect(result.filter(x => x.label === "group").map(x => x.textEdit?.newText)).toEqual(["\n group: "]);
});
it("does not add new line if no key in line", async () => {
const input = "run-n|";
const result = await complete(...getPositionFromCursor(input));
expect(result.filter(x => x.label === "run-name").map(x => x.textEdit?.newText)).toEqual(["run-name: "]);
});
it("adds new line for nested mapping", async () => {
const input = "on:\n workflow_dispatch: in|";
const result = await complete(...getPositionFromCursor(input));
expect(result.filter(x => x.label === "inputs").map(x => x.textEdit?.newText)).toEqual(["\n inputs:\n "]);
});
it("adds : for one-of", async () => {
const input = "on:\n check_run:\n ty|";
const result = await complete(...getPositionFromCursor(input));
expect(result.filter(x => x.label === "types").map(x => x.textEdit?.newText)).toEqual(["types: "]);
});
it("does not add : for one-of in key mode", async () => {
const input = "on:\n check_run: ty|";
const result = await complete(...getPositionFromCursor(input));
expect(result.filter(x => x.label === "types").map(x => x.textEdit?.newText)).toEqual(["types"]);
});
});
+2 -2
View File
@@ -24,7 +24,7 @@ import {isPlaceholder, transform} from "./utils/transform";
import {fetchOrConvertWorkflowTemplate, fetchOrParseWorkflow} from "./utils/workflow-cache";
import {Value, ValueProviderConfig} from "./value-providers/config";
import {defaultValueProviders} from "./value-providers/default";
import {definitionValues} from "./value-providers/definition";
import {DefinitionValueMode, definitionValues} from "./value-providers/definition";
export function getExpressionInput(input: string, pos: number): string {
// Find start marker around the cursor position
@@ -180,7 +180,7 @@ async function getValues(
return [];
}
const values = definitionValues(def, indentation);
const values = definitionValues(def, indentation, keyToken ? DefinitionValueMode.Key : DefinitionValueMode.Parent);
return filterAndSortCompletionOptions(values, existingValues);
}
@@ -8,7 +8,7 @@ import {getEventPayload, getSupportedEventTypes} from "./events/eventPayloads";
import {getInputsContext} from "./inputs";
export function getGithubContext(workflowContext: WorkflowContext, mode: Mode): DescriptionDictionary {
// https://docs.github.com/en/actions/learn-github-actions/contexts#github-cwontext
// https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
const keys = [
"action",
"action_path",
@@ -16,6 +16,7 @@ export function getGithubContext(workflowContext: WorkflowContext, mode: Mode):
"action_repository",
"action_status",
"actor",
"actor_id",
"api_url",
"base_ref",
"env",
@@ -25,13 +26,16 @@ export function getGithubContext(workflowContext: WorkflowContext, mode: Mode):
"graphql_url",
"head_ref",
"job",
"job_workflow_sha",
"path",
"ref",
"ref_name",
"ref_protected",
"ref_type",
"path",
"repository",
"repository_id",
"repository_owner",
"repository_owner_id",
"repositoryUrl",
"retention_days",
"run_id",
@@ -43,6 +47,8 @@ export function getGithubContext(workflowContext: WorkflowContext, mode: Mode):
"token",
"triggering_actor",
"workflow",
"workflow_ref",
"workflow_sha",
"workspace"
];
@@ -9,15 +9,30 @@ import {getWorkflowSchema} from "@actions/workflow-parser/workflows/workflow-sch
import {Value} from "./config";
import {stringsToValues} from "./strings-to-values";
export function definitionValues(def: Definition, indentation: string): Value[] {
export enum DefinitionValueMode {
/**
* We're getting completion options for a parent token
* foo:
* ba|
*/
Parent,
/**
* We're getting completion options for a key token. For example:
* foo: |
*/
Key
}
export function definitionValues(def: Definition, indentation: string, mode: DefinitionValueMode): Value[] {
const schema = getWorkflowSchema();
if (def instanceof MappingDefinition) {
return mappingValues(def, schema.definitions, indentation);
return mappingValues(def, schema.definitions, indentation, mode);
}
if (def instanceof OneOfDefinition) {
return oneOfValues(def, schema.definitions, indentation);
return oneOfValues(def, schema.definitions, indentation, mode);
}
if (def instanceof BooleanDefinition) {
@@ -36,7 +51,7 @@ export function definitionValues(def: Definition, indentation: string): Value[]
if (def instanceof SequenceDefinition) {
const itemDef = schema.getDefinition(def.itemType);
if (itemDef) {
return definitionValues(itemDef, indentation);
return definitionValues(itemDef, indentation, mode);
}
}
@@ -46,7 +61,8 @@ export function definitionValues(def: Definition, indentation: string): Value[]
function mappingValues(
mappingDefinition: MappingDefinition,
definitions: {[key: string]: Definition},
indentation: string
indentation: string,
mode: DefinitionValueMode
): Value[] {
const properties: Value[] = [];
for (const [key, value] of Object.entries(mappingDefinition.properties)) {
@@ -60,21 +76,38 @@ function mappingValues(
if (typeDef) {
switch (typeDef.definitionType) {
case DefinitionType.Sequence:
insertText = `${key}:\n${indentation}- `;
if (mode == DefinitionValueMode.Key) {
insertText = `\n${indentation}${key}:\n${indentation}${indentation}- `;
} else {
insertText = `${key}:\n${indentation}- `;
}
break;
case DefinitionType.Mapping:
insertText = `${key}:\n${indentation}`;
if (mode == DefinitionValueMode.Key) {
insertText = `\n${indentation}${key}:\n${indentation}${indentation}`;
} else {
insertText = `${key}:\n${indentation}`;
}
break;
case DefinitionType.OneOf:
// No special insertText in this case
if (mode == DefinitionValueMode.Parent) {
insertText = `${key}: `;
} else {
// No special insertText in this case
}
break;
case DefinitionType.String:
case DefinitionType.Boolean:
insertText = `\n${indentation}${key}: `;
if (mode == DefinitionValueMode.Key) {
insertText = `\n${indentation}${key}: `;
} else {
insertText = `${key}: `;
}
break;
default:
insertText = `${key}: `;
}
@@ -93,11 +126,12 @@ function mappingValues(
function oneOfValues(
oneOfDefinition: OneOfDefinition,
definitions: {[key: string]: Definition},
indentation: string
indentation: string,
mode: DefinitionValueMode
): Value[] {
const values: Value[] = [];
for (const key of oneOfDefinition.oneOf) {
values.push(...definitionValues(definitions[key], indentation));
values.push(...definitionValues(definitions[key], indentation, mode));
}
return distinctValues(values);
}
+7 -2
View File
@@ -1,5 +1,10 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.3.3"
"packages": [
"expressions",
"workflow-parser",
"languageservice",
"languageserver"
],
"version": "0.3.9"
}
+159 -68
View File
@@ -135,7 +135,7 @@
},
"expressions": {
"name": "@actions/expressions",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.0.3",
@@ -395,11 +395,11 @@
},
"languageserver": {
"name": "@actions/languageserver",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"dependencies": {
"@actions/languageservice": "^0.3.3",
"@actions/workflow-parser": "^0.3.3",
"@actions/languageservice": "^0.3.9",
"@actions/workflow-parser": "^0.3.9",
"@octokit/rest": "^19.0.7",
"@octokit/types": "^9.0.0",
"vscode-languageserver": "^8.0.2",
@@ -678,11 +678,11 @@
},
"languageservice": {
"name": "@actions/languageservice",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"dependencies": {
"@actions/expressions": "^0.3.3",
"@actions/workflow-parser": "^0.3.3",
"@actions/expressions": "^0.3.9",
"@actions/workflow-parser": "^0.3.9",
"vscode-languageserver-textdocument": "^1.0.7",
"vscode-languageserver-types": "^3.17.2",
"vscode-uri": "^3.0.7",
@@ -975,16 +975,89 @@
}
},
"node_modules/@babel/code-frame": {
"version": "7.18.6",
"version": "7.22.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/highlight": "^7.18.6"
"@babel/highlight": "^7.22.13",
"chalk": "^2.4.2"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/code-frame/node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/@babel/code-frame/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/@babel/code-frame/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/@babel/code-frame/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/compat-data": {
"version": "7.20.1",
"dev": true,
@@ -1028,12 +1101,14 @@
"license": "MIT"
},
"node_modules/@babel/generator": {
"version": "7.20.4",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.20.2",
"@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
},
"engines": {
@@ -1071,31 +1146,34 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
"version": "7.18.9",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
"version": "7.19.0",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/template": "^7.18.10",
"@babel/types": "^7.19.0"
"@babel/template": "^7.22.15",
"@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
"version": "7.18.6",
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
"integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.18.6"
"@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
@@ -1150,28 +1228,31 @@
}
},
"node_modules/@babel/helper-split-export-declaration": {
"version": "7.18.6",
"version": "7.22.6",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.18.6"
"@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-string-parser": {
"version": "7.19.4",
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
@@ -1198,12 +1279,13 @@
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"@babel/helper-validator-identifier": "^7.22.20",
"chalk": "^2.4.2",
"js-tokens": "^4.0.0"
},
"engines": {
@@ -1275,9 +1357,10 @@
}
},
"node_modules/@babel/parser": {
"version": "7.20.3",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"license": "MIT",
"bin": {
"parser": "bin/babel-parser.js"
},
@@ -1460,31 +1543,33 @@
}
},
"node_modules/@babel/template": {
"version": "7.18.10",
"version": "7.22.15",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.18.6",
"@babel/parser": "^7.18.10",
"@babel/types": "^7.18.10"
"@babel/code-frame": "^7.22.13",
"@babel/parser": "^7.22.15",
"@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
"version": "7.20.1",
"version": "7.23.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.18.6",
"@babel/generator": "^7.20.1",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.19.0",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.20.1",
"@babel/types": "^7.20.0",
"@babel/code-frame": "^7.22.13",
"@babel/generator": "^7.23.0",
"@babel/helper-environment-visitor": "^7.22.20",
"@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.23.0",
"@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -1493,12 +1578,13 @@
}
},
"node_modules/@babel/types": {
"version": "7.20.2",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-string-parser": "^7.19.4",
"@babel/helper-validator-identifier": "^7.19.1",
"@babel/helper-string-parser": "^7.22.5",
"@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -4388,11 +4474,12 @@
}
},
"node_modules/axios": {
"version": "1.1.3",
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
"dev": true,
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.0",
"follow-redirects": "^1.15.4",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@@ -6192,7 +6279,9 @@
"license": "ISC"
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"version": "1.15.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
"integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
"dev": true,
"funding": [
{
@@ -6200,7 +6289,6 @@
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
@@ -6937,9 +7025,10 @@
}
},
"node_modules/ip": {
"version": "2.0.0",
"dev": true,
"license": "MIT"
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
"integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==",
"dev": true
},
"node_modules/is-arrayish": {
"version": "0.2.1",
@@ -11470,9 +11559,10 @@
}
},
"node_modules/word-wrap": {
"version": "1.2.3",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
@@ -11668,8 +11758,9 @@
"license": "ISC"
},
"node_modules/yaml": {
"version": "2.1.3",
"license": "ISC",
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz",
"integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==",
"engines": {
"node": ">= 14"
}
@@ -11720,10 +11811,10 @@
},
"workflow-parser": {
"name": "@actions/workflow-parser",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"dependencies": {
"@actions/expressions": "^0.3.3",
"@actions/expressions": "^0.3.9",
"cronstrue": "^2.21.0",
"yaml": "^2.0.0-8"
},
+1
View File
@@ -0,0 +1 @@
Release 0.3.5
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# this script is used to generate release notes for a given release
# first argument is the pull request id for the last release
# the second is the new release number
# the script then grabs every pull request merged since that pull request
# and outputs a string of release notes
# get the new release number
NEW_RELEASE=$2
echo "Generating release notes for $NEW_RELEASE"
# get the last release pull request id
LAST_RELEASE_PR=$1
#get when the last release was merged
LAST_RELEASE_MERGED_AT=$(gh pr view $LAST_RELEASE_PR --repo actions/languageservices --json mergedAt | jq -r '.mergedAt')
CHANGELIST=$(gh pr list --repo actions/languageservices --base main --state merged --json title --search "merged:>$LAST_RELEASE_MERGED_AT -label:no-release")
# store the release notes in a variable so we can use it later
echo "Release $NEW_RELEASE" >> releasenotes.md
echo $CHANGELIST | jq -r '.[].title' | while read line; do
echo " - $line" >> releasenotes.md
done
echo " "
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
VERSION=$(cat lerna.json | jq -r '.version')
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
if [ "$1" == "major" ]; then
MAJOR=$((MAJOR+1))
MINOR=0
PATCH=0
elif [ "$1" == "minor" ]; then
MINOR=$((MINOR+1))
PATCH=0
elif [ "$1" == "patch" ]; then
PATCH=$((PATCH+1))
else
echo "Invalid version type. Use 'major', 'minor' or 'patch'"
exit 1
fi
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo $NEW_VERSION
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
);
```
`convertWorkflowTemplate` then takes that intermediate representation and converts it to a [`WorkflowTemplate`](./src/workflow-template.ts) object, which is a more convenient representation for working with workflows.
`convertWorkflowTemplate` then takes that intermediate representation and converts it to a [`WorkflowTemplate`](./src/model/workflow-template.ts) object, which is a more convenient representation for working with workflows.
```typescript
const workflowTemplate = await convertWorkflowTemplate(result.context, result.value);
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/workflow-parser",
"version": "0.3.3",
"version": "0.3.9",
"license": "MIT",
"type": "module",
"source": "./src/index.ts",
@@ -43,7 +43,7 @@
"watch": "tsc --build tsconfig.build.json --watch"
},
"dependencies": {
"@actions/expressions": "^0.3.3",
"@actions/expressions": "^0.3.9",
"cronstrue": "^2.21.0",
"yaml": "^2.0.0-8"
},
+4 -3
View File
@@ -577,7 +577,8 @@
"mapping": {
"properties": {
"types": "merge-group-activity",
"branches": "event-branches"
"branches": "event-branches",
"branches-ignore": "event-branches-ignore"
}
}
},
@@ -1182,7 +1183,7 @@
]
},
"workflow-run-activity": {
"description": "The types of workflow run activity that trigger the workflow. Suupported activity types: `completed`, `requested`, `in_progress`.",
"description": "The types of workflow run activity that trigger the workflow. Supported activity types: `completed`, `requested`, `in_progress`.",
"one-of": [
"workflow-run-activity-type",
"workflow-run-activity-types"
@@ -2488,7 +2489,7 @@
"string": {
"require-non-empty": true
},
"description": "Use `shell` to override the default shell settings in the runner's operating system. You can use built-in shell keywords, or you can define a custom set of shell options. The shell command that is run internally executes a temporary file that contains the comands specified in `run`."
"description": "Use `shell` to override the default shell settings in the runner's operating system. You can use built-in shell keywords, or you can define a custom set of shell options. The shell command that is run internally executes a temporary file that contains the commands specified in `run`."
},
"working-directory": {
"string": {
+7 -2
View File
@@ -73,8 +73,10 @@ on:
- deleted
merge_group:
branches:
- master
- main
- master
- main
branches-ignore:
- develop
types:
- checks_requested
milestone:
@@ -321,6 +323,9 @@ jobs:
"master",
"main"
],
"branches-ignore": [
"develop"
],
"types": [
"checks_requested"
]