Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f8bba4305 | |||
| 43feb1a1f4 | |||
| d4aeaa3f3f | |||
| e4f8f24be3 | |||
| 168cf44245 | |||
| d4676627d8 | |||
| d6b3b9d3e8 | |||
| 9ba7e48fbf | |||
| 6bd54f1b94 | |||
| fcc72a8d97 | |||
| ce3b746742 | |||
| 300c0dc569 | |||
| 6f63074d43 | |||
| 7504f49ab6 | |||
| 629c9e23da | |||
| 9838063a4e | |||
| 01c3723641 | |||
| 7cf82aa761 | |||
| 028715d071 | |||
| cec59d9a4d | |||
| f316d205a9 | |||
| dd8308d7f9 | |||
| 17f511bb6e | |||
| fca6e0aec1 | |||
| 4faa096820 | |||
| ce274ee2ce | |||
| a13e5cd088 | |||
| 1f3436c3ca | |||
| 880d3e4109 | |||
| 09fd00ed88 | |||
| 435a10d9b6 | |||
| 311a948ff0 | |||
| b0fd29ab60 | |||
| ccf95ef540 | |||
| e597a0c800 | |||
| 80c99e6e38 | |||
| 655d268694 | |||
| 756ce20db2 | |||
| 04b9c0c333 | |||
| ffef418dbc | |||
| e2ec264801 | |||
| ea15cac4e0 | |||
| 81db06000a | |||
| f0a24df8db | |||
| 7c0bffb677 | |||
| 6fedfd7fa4 | |||
| 8725c3c1c6 | |||
| 977d0ea9cd | |||
| 48247b8730 | |||
| bdee101604 | |||
| 7a41cd9e66 | |||
| 0d97e79d94 | |||
| 50b08a3a22 | |||
| f02e9593c2 |
@@ -1,4 +1,6 @@
|
||||
name: Build & Test
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -11,9 +13,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 16.15
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16.15
|
||||
cache: 'npm'
|
||||
|
||||
@@ -25,9 +25,9 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ jobs:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check if version has changed
|
||||
id: check-version
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const version = '${{ inputs.version }}' || require('./lerna.json').version;
|
||||
@@ -65,9 +65,9 @@ jobs:
|
||||
PKG_VERSION: "" # will be set in the workflow
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: "npm"
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
- run: npm ci
|
||||
|
||||
- name: Create release
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require("fs");
|
||||
|
||||
@@ -8,6 +8,20 @@ This repository contains multiple npm packages for working with GitHub Actions w
|
||||
- [languageserver](./languageserver) - Language Server for GitHub Actions, hosting the language service for LSP-compatible editors
|
||||
- [browser-playground](./browser-playground) - Browser-based playground for the language service
|
||||
|
||||
## Contributing
|
||||
### Note
|
||||
|
||||
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
||||
Thank you for your interest in this GitHub repo, however, right now we are not taking contributions.
|
||||
|
||||
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features we’re working on and what stage they’re in.
|
||||
|
||||
We are taking the following steps to better direct requests related to GitHub Actions, including:
|
||||
|
||||
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
|
||||
|
||||
3. Security Issues should be handled as per our [security.md](security.md)
|
||||
|
||||
We will still provide security updates for this project and fix major breaking changes during this time.
|
||||
|
||||
You are welcome to still raise bugs in this repo.
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
"typescript": "^4.9.4",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
"webpack-dev-server": ">=5.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/expressions",
|
||||
"version": "0.3.13",
|
||||
"version": "0.3.20",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
@@ -9,10 +9,12 @@
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js"
|
||||
"import": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"./*": {
|
||||
"import": "./dist/*.js"
|
||||
"import": "./dist/*.js",
|
||||
"types": "./dist/*.d.ts"
|
||||
}
|
||||
},
|
||||
"typesVersions": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/languageserver",
|
||||
"version": "0.3.13",
|
||||
"version": "0.3.20",
|
||||
"description": "Language server for GitHub Actions",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
@@ -43,9 +43,9 @@
|
||||
"watch": "tsc --build tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/languageservice": "^0.3.13",
|
||||
"@actions/workflow-parser": "^0.3.13",
|
||||
"@octokit/rest": "^19.0.7",
|
||||
"@actions/languageservice": "^0.3.20",
|
||||
"@actions/workflow-parser": "^0.3.20",
|
||||
"@octokit/rest": "^21.1.1",
|
||||
"@octokit/types": "^9.0.0",
|
||||
"vscode-languageserver": "^8.0.2",
|
||||
"vscode-languageserver-textdocument": "^1.0.7",
|
||||
|
||||
@@ -125,7 +125,7 @@ async function getRemoteSecrets(
|
||||
environmentSecrets:
|
||||
(environmentName &&
|
||||
(await cache.get(`${repo.owner}/${repo.name}/secrets/environment/${environmentName}`, undefined, () =>
|
||||
fetchEnvironmentSecrets(octokit, repo.id, environmentName)
|
||||
fetchEnvironmentSecrets(octokit, repo.owner, repo.name, environmentName)
|
||||
))) ||
|
||||
[],
|
||||
orgSecrets: await cache.get(`${repo.owner}/secrets`, undefined, () => fetchOrganizationSecrets(octokit, repo))
|
||||
@@ -151,14 +151,16 @@ async function fetchSecrets(octokit: Octokit, owner: string, name: string): Prom
|
||||
|
||||
async function fetchEnvironmentSecrets(
|
||||
octokit: Octokit,
|
||||
repositoryId: number,
|
||||
owner: string,
|
||||
name: string,
|
||||
environmentName: string
|
||||
): Promise<StringData[]> {
|
||||
try {
|
||||
return await octokit.paginate(
|
||||
octokit.actions.listEnvironmentSecrets,
|
||||
{
|
||||
repository_id: repositoryId,
|
||||
owner,
|
||||
repo: name,
|
||||
environment_name: environmentName,
|
||||
per_page: 100
|
||||
},
|
||||
|
||||
@@ -115,7 +115,7 @@ export async function getRemoteVariables(
|
||||
environmentVariables:
|
||||
(environmentName &&
|
||||
(await cache.get(`${repo.owner}/${repo.name}/vars/environment/${environmentName}`, undefined, () =>
|
||||
fetchEnvironmentVariables(octokit, repo.id, environmentName)
|
||||
fetchEnvironmentVariables(octokit, repo.owner, repo.name, environmentName)
|
||||
))) ||
|
||||
[],
|
||||
organizationVariables: await cache.get(`${repo.owner}/vars`, undefined, () =>
|
||||
@@ -146,14 +146,16 @@ async function fetchVariables(octokit: Octokit, owner: string, name: string): Pr
|
||||
|
||||
async function fetchEnvironmentVariables(
|
||||
octokit: Octokit,
|
||||
repositoryId: number,
|
||||
owner: string,
|
||||
name: string,
|
||||
environmentName: string
|
||||
): Promise<Pair[]> {
|
||||
try {
|
||||
return await octokit.paginate(
|
||||
octokit.actions.listEnvironmentVariables,
|
||||
{
|
||||
repository_id: repositoryId,
|
||||
owner: owner,
|
||||
repo: name,
|
||||
environment_name: environmentName,
|
||||
per_page: 100
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/languageservice",
|
||||
"version": "0.3.13",
|
||||
"version": "0.3.20",
|
||||
"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.13",
|
||||
"@actions/workflow-parser": "^0.3.13",
|
||||
"@actions/expressions": "^0.3.20",
|
||||
"@actions/workflow-parser": "^0.3.20",
|
||||
"vscode-languageserver-textdocument": "^1.0.7",
|
||||
"vscode-languageserver-types": "^3.17.2",
|
||||
"vscode-uri": "^3.0.8",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {promises as fs} from "fs";
|
||||
import Webhook from "./webhook.js";
|
||||
|
||||
import schemaImport from "rest-api-description/descriptions/api.github.com/dereferenced/api.github.com.deref.json" assert {type: "json"};
|
||||
import schemaImport from "rest-api-description/descriptions/api.github.com/dereferenced/api.github.com.deref.json";
|
||||
import {deduplicateWebhooks} from "./deduplicate.js";
|
||||
const schema = schemaImport as any;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result.length).toEqual(8);
|
||||
expect(result.length).toEqual(9);
|
||||
expect(result[0].label).toEqual("concurrency");
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
|`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result.length).toEqual(20);
|
||||
expect(result.length).toEqual(21);
|
||||
});
|
||||
|
||||
it("string definition completion in sequence", async () => {
|
||||
@@ -243,7 +243,7 @@ jobs:
|
||||
runs-|`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result).toHaveLength(20);
|
||||
expect(result).toHaveLength(21);
|
||||
});
|
||||
|
||||
it("job key with comment afterwards", async () => {
|
||||
@@ -254,7 +254,7 @@ jobs:
|
||||
#`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result).toHaveLength(20);
|
||||
expect(result).toHaveLength(21);
|
||||
});
|
||||
|
||||
it("job key with other values afterwards", async () => {
|
||||
@@ -266,7 +266,7 @@ jobs:
|
||||
concurrency: 'group-name'`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result).toHaveLength(19);
|
||||
expect(result).toHaveLength(20);
|
||||
});
|
||||
|
||||
it("step key without space after colon", async () => {
|
||||
@@ -335,7 +335,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).toHaveLength(16);
|
||||
expect(result).toHaveLength(17);
|
||||
});
|
||||
|
||||
it("complete from behind a colon will replace it", async () => {
|
||||
@@ -348,7 +348,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
`;
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
expect(result).toHaveLength(16);
|
||||
expect(result).toHaveLength(17);
|
||||
const textEdit = result[0].textEdit as TextEdit;
|
||||
expect(textEdit.range).toEqual({
|
||||
start: {line: 5, character: 4},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import descriptions from "./descriptions.json" assert {type: "json"};
|
||||
import descriptions from "./descriptions.json";
|
||||
|
||||
export const RootContext = "root";
|
||||
const FunctionContext = "functions";
|
||||
|
||||
@@ -3,8 +3,8 @@ import {data, DescriptionDictionary} from "@actions/expressions";
|
||||
import webhookObjects from "./objects.json";
|
||||
import webhooks from "./webhooks.json";
|
||||
|
||||
import schedule from "./schedule.json" assert {type: "json"};
|
||||
import workflow_call from "./workflow_call.json" assert {type: "json"};
|
||||
import schedule from "./schedule.json";
|
||||
import workflow_call from "./workflow_call.json";
|
||||
|
||||
const customEventPayloads: {[name: string]: unknown} = {
|
||||
schedule,
|
||||
|
||||
@@ -21,8 +21,18 @@ describe("end-to-end", () => {
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
|
||||
expect(result).not.toBeUndefined();
|
||||
expect(result.length).toEqual(8);
|
||||
expect(result.length).toEqual(9);
|
||||
const labels = result.map(x => x.label);
|
||||
expect(labels).toEqual(["concurrency", "defaults", "env", "jobs", "name", "on", "permissions", "run-name"]);
|
||||
expect(labels).toEqual([
|
||||
"concurrency",
|
||||
"defaults",
|
||||
"description",
|
||||
"env",
|
||||
"jobs",
|
||||
"name",
|
||||
"on",
|
||||
"permissions",
|
||||
"run-name"
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@
|
||||
"languageservice",
|
||||
"languageserver"
|
||||
],
|
||||
"version": "0.3.13"
|
||||
"version": "0.3.20"
|
||||
}
|
||||
Generated
+4022
-2921
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -8,6 +8,6 @@
|
||||
"./languageserver"
|
||||
],
|
||||
"devDependencies": {
|
||||
"lerna": "^6.0.3"
|
||||
"lerna": "^8.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Release 0.3.5
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/workflow-parser",
|
||||
"version": "0.3.13",
|
||||
"version": "0.3.20",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
@@ -9,10 +9,12 @@
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js"
|
||||
"import": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"./*": {
|
||||
"import": "./dist/*.js"
|
||||
"import": "./dist/*.js",
|
||||
"types": "./dist/*.d.ts"
|
||||
}
|
||||
},
|
||||
"typesVersions": {
|
||||
@@ -43,7 +45,7 @@
|
||||
"watch": "tsc --build tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/expressions": "^0.3.13",
|
||||
"@actions/expressions": "^0.3.20",
|
||||
"cronstrue": "^2.21.0",
|
||||
"yaml": "^2.0.0-8"
|
||||
},
|
||||
|
||||
@@ -7,10 +7,12 @@ import {TokenType} from "../../templates/tokens/types";
|
||||
import {
|
||||
BranchFilterConfig,
|
||||
EventsConfig,
|
||||
NamesFilterConfig,
|
||||
PathFilterConfig,
|
||||
ScheduleConfig,
|
||||
TagFilterConfig,
|
||||
TypesFilterConfig,
|
||||
VersionsFilterConfig,
|
||||
WorkflowFilterConfig
|
||||
} from "../workflow-template";
|
||||
import {isValidCron} from "./cron";
|
||||
@@ -76,10 +78,11 @@ export function convertOn(context: TemplateContext, token: TemplateToken): Event
|
||||
...convertPatternFilter("tags", eventToken),
|
||||
...convertPatternFilter("paths", eventToken),
|
||||
...convertFilter("types", eventToken),
|
||||
...convertFilter("versions", eventToken),
|
||||
...convertFilter("names", eventToken),
|
||||
...convertFilter("workflows", eventToken)
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -121,8 +124,8 @@ function convertPatternFilter<T extends BranchFilterConfig & TagFilterConfig & P
|
||||
return result;
|
||||
}
|
||||
|
||||
function convertFilter<T extends TypesFilterConfig & WorkflowFilterConfig>(
|
||||
name: "types" | "workflows",
|
||||
function convertFilter<T extends TypesFilterConfig & WorkflowFilterConfig & VersionsFilterConfig & NamesFilterConfig>(
|
||||
name: "types" | "workflows" | "versions" | "names",
|
||||
token: MappingToken
|
||||
): T {
|
||||
const result = {} as T;
|
||||
|
||||
@@ -16,7 +16,16 @@ export function convertJob(context: TemplateContext, jobKey: StringToken, token:
|
||||
context.error(jobKey, error);
|
||||
}
|
||||
|
||||
let concurrency, container, env, environment, name, outputs, runsOn, services, strategy: TemplateToken | undefined;
|
||||
let concurrency,
|
||||
container,
|
||||
env,
|
||||
environment,
|
||||
name,
|
||||
outputs,
|
||||
runsOn,
|
||||
services,
|
||||
strategy,
|
||||
snapshot: TemplateToken | undefined;
|
||||
let needs: StringToken[] | undefined = undefined;
|
||||
let steps: Step[] = [];
|
||||
let workflowJobRef: StringToken | undefined;
|
||||
@@ -86,6 +95,10 @@ export function convertJob(context: TemplateContext, jobKey: StringToken, token:
|
||||
services = item.value;
|
||||
break;
|
||||
|
||||
case "snapshot":
|
||||
snapshot = item.value;
|
||||
break;
|
||||
|
||||
case "steps":
|
||||
steps = convertSteps(context, item.value);
|
||||
break;
|
||||
@@ -147,7 +160,8 @@ export function convertJob(context: TemplateContext, jobKey: StringToken, token:
|
||||
container,
|
||||
services,
|
||||
outputs,
|
||||
steps
|
||||
steps,
|
||||
snapshot
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ export type BaseJob = {
|
||||
concurrency?: TemplateToken;
|
||||
strategy?: TemplateToken;
|
||||
outputs?: MappingToken;
|
||||
snapshot?: TemplateToken;
|
||||
};
|
||||
|
||||
// `job-factory` in the schema
|
||||
@@ -129,6 +130,7 @@ export type EventsConfig = {
|
||||
repository_dispatch?: TypesFilterConfig;
|
||||
release?: TypesFilterConfig;
|
||||
watch?: TypesFilterConfig;
|
||||
image_versions?: TypesFilterConfig & VersionsFilterConfig & NamesFilterConfig;
|
||||
|
||||
// Index signature to allow easier lookup
|
||||
[eventName: string]: unknown;
|
||||
@@ -138,6 +140,14 @@ export type TypesFilterConfig = {
|
||||
types?: string[];
|
||||
};
|
||||
|
||||
export type VersionsFilterConfig = {
|
||||
versions?: string[];
|
||||
};
|
||||
|
||||
export type NamesFilterConfig = {
|
||||
names?: string[];
|
||||
};
|
||||
|
||||
export type BranchFilterConfig = {
|
||||
branches?: string[];
|
||||
"branches-ignore"?: string[];
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"properties": {
|
||||
"on": "on",
|
||||
"name": "workflow-name",
|
||||
"description": "workflow-description",
|
||||
"run-name": "run-name",
|
||||
"defaults": "workflow-defaults",
|
||||
"env": "workflow-env",
|
||||
@@ -28,6 +29,7 @@
|
||||
"required": true
|
||||
},
|
||||
"name": "workflow-name",
|
||||
"description": "workflow-description",
|
||||
"run-name": "run-name",
|
||||
"defaults": "workflow-defaults",
|
||||
"env": "workflow-env",
|
||||
@@ -44,6 +46,10 @@
|
||||
"description": "The name of the workflow that GitHub displays on your repository's 'Actions' tab.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#name)",
|
||||
"string": {}
|
||||
},
|
||||
"workflow-description": {
|
||||
"description": "A description for your workflow or reusable workflow",
|
||||
"string": {}
|
||||
},
|
||||
"run-name": {
|
||||
"context": [
|
||||
"github",
|
||||
@@ -93,6 +99,7 @@
|
||||
"discussion_comment": "discussion-comment",
|
||||
"fork": "fork",
|
||||
"gollum": "gollum",
|
||||
"image_version": "image-version",
|
||||
"issue_comment": "issue-comment",
|
||||
"issues": "issues",
|
||||
"label": "label",
|
||||
@@ -134,6 +141,7 @@
|
||||
"discussion-comment-string",
|
||||
"fork-string",
|
||||
"gollum-string",
|
||||
"image-version-string",
|
||||
"issue-comment-string",
|
||||
"issues-string",
|
||||
"label-string",
|
||||
@@ -430,6 +438,47 @@
|
||||
"description": "Runs your workflow when someone creates or updates a Wiki page.",
|
||||
"null": {}
|
||||
},
|
||||
"image-version-string": {
|
||||
"description": "Runs your workflow when an image version is created or changes state.",
|
||||
"string": {
|
||||
"constant": "image_version"
|
||||
}
|
||||
},
|
||||
"image-version": {
|
||||
"description": "Runs your workflow when an image version is created or changes state.",
|
||||
"one-of": [
|
||||
"null",
|
||||
"image-version-mapping"
|
||||
]
|
||||
},
|
||||
"image-version-mapping": {
|
||||
"mapping": {
|
||||
"properties": {
|
||||
"types": "image-version-activity",
|
||||
"names": "event-names",
|
||||
"versions": "event-versions"
|
||||
}
|
||||
}
|
||||
},
|
||||
"image-version-activity": {
|
||||
"description": "The types of image version activity that trigger the workflow. Supported activity types: `created`, `ready`, `deleted`.",
|
||||
"one-of": [
|
||||
"image-version-activity-type",
|
||||
"image-version-activity-types"
|
||||
]
|
||||
},
|
||||
"image-version-activity-types": {
|
||||
"sequence": {
|
||||
"item-type": "image-version-activity-type"
|
||||
}
|
||||
},
|
||||
"image-version-activity-type": {
|
||||
"allowed-values": [
|
||||
"created",
|
||||
"ready",
|
||||
"deleted"
|
||||
]
|
||||
},
|
||||
"issue-comment-string": {
|
||||
"description": "Runs your workflow when an issue or pull request comment is created, edited, or deleted.",
|
||||
"string": {
|
||||
@@ -1215,6 +1264,13 @@
|
||||
"sequence-of-non-empty-string"
|
||||
]
|
||||
},
|
||||
"event-names": {
|
||||
"description": "Use the `names` filter when you want to include names via patterns or when you want to both include and exclude names using patterns. ",
|
||||
"one-of": [
|
||||
"non-empty-string",
|
||||
"sequence-of-non-empty-string"
|
||||
]
|
||||
},
|
||||
"event-tags": {
|
||||
"description": "Use the `tags` filter when you want to include tag name patterns or when you want to both include and exclude tag names patterns. You cannot use both the `tags` and `tags-ignore` filters for the same event in a workflow.",
|
||||
"one-of": [
|
||||
@@ -1243,6 +1299,13 @@
|
||||
"sequence-of-non-empty-string"
|
||||
]
|
||||
},
|
||||
"event-versions": {
|
||||
"description": "Use the `versions` filter when you want to include versions via patterns or when you want to both include and exclude versions using patterns. ",
|
||||
"one-of": [
|
||||
"non-empty-string",
|
||||
"sequence-of-non-empty-string"
|
||||
]
|
||||
},
|
||||
"repository-dispatch-string": {
|
||||
"description": "You can use the GitHub API to trigger a webhook event called `repository_dispatch` when you want to trigger a workflow for activity that happens outside of GitHub.",
|
||||
"string": {
|
||||
@@ -1515,6 +1578,10 @@
|
||||
"type": "permission-level-any",
|
||||
"description": "Actions workflows, workflow runs, and artifacts."
|
||||
},
|
||||
"artifact-metadata": {
|
||||
"type": "permission-level-any",
|
||||
"description": "Storage and deployment records for build artifacts."
|
||||
},
|
||||
"attestations": {
|
||||
"type": "permission-level-any",
|
||||
"description": "Artifact attestations."
|
||||
@@ -1543,6 +1610,10 @@
|
||||
"type": "permission-level-any",
|
||||
"description": "Issues and related comments, assignees, labels, and milestones."
|
||||
},
|
||||
"models": {
|
||||
"type": "permission-level-read-or-no-access",
|
||||
"description": "Call AI models with GitHub Models."
|
||||
},
|
||||
"packages": {
|
||||
"type": "permission-level-any",
|
||||
"description": "Packages published to the GitHub Package Platform."
|
||||
@@ -1700,7 +1771,8 @@
|
||||
"concurrency": "job-concurrency",
|
||||
"outputs": "job-outputs",
|
||||
"defaults": "job-defaults",
|
||||
"steps": "steps"
|
||||
"steps": "steps",
|
||||
"snapshot": "snapshot"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1844,6 +1916,43 @@
|
||||
"loose-value-type": "any"
|
||||
}
|
||||
},
|
||||
"snapshot": {
|
||||
"description": "Use `snapshot` to define a custom image you want to create or update after your job succeeds by taking a snapshot of your runner.",
|
||||
"one-of": [
|
||||
"non-empty-string",
|
||||
"snapshot-mapping"
|
||||
]
|
||||
},
|
||||
"snapshot-mapping": {
|
||||
"mapping": {
|
||||
"properties": {
|
||||
"image-name": {
|
||||
"description": "The desired name of the custom image you want to create or update.",
|
||||
"type": "non-empty-string",
|
||||
"required": true
|
||||
},
|
||||
"if": "snapshot-if",
|
||||
"version": {
|
||||
"description": "The desired major version updates upon a new custom image version creation.",
|
||||
"type": "non-empty-string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"snapshot-if": {
|
||||
"context": [
|
||||
"github",
|
||||
"inputs",
|
||||
"vars",
|
||||
"needs",
|
||||
"strategy",
|
||||
"matrix"
|
||||
],
|
||||
"description": "Use the if conditional to prevent a snapshot from being taken unless a condition is met. Any supported context and expression can be used to create a conditional. Expressions in an `if` conditional do not require the bracketed expression syntax. When you use expressions in an `if` conditional, you may omit the expression syntax because GitHub automatically evaluates the `if` conditional as an expression.",
|
||||
"string": {
|
||||
"is-expression": true
|
||||
}
|
||||
},
|
||||
"runs-on": {
|
||||
"description": "Use `runs-on` to define the type of machine to run the job on.\n* The destination machine can be either a GitHub-hosted runner, larger runner, or a self-hosted runner.\n* You can target runners based on the labels assigned to them, or their group membership, or a combination of these.\n* You can provide `runs-on` as a single string or as an array of strings.\n* If you specify an array of strings, your workflow will execute on any runner that matches all of the specified `runs-on` values.\n* If you would like to run your workflow on multiple machines, use `jobs.<job_id>.strategy`.",
|
||||
"context": [
|
||||
@@ -2514,4 +2623,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {JSONObjectReader} from "../templates/json-object-reader";
|
||||
import {TemplateSchema} from "../templates/schema";
|
||||
import WorkflowSchema from "../workflow-v1.0.json" assert {type: "json"};
|
||||
import WorkflowSchema from "../workflow-v1.0.json";
|
||||
|
||||
let schema: TemplateSchema;
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
include-source: false # Drop file/line/col from output
|
||||
---
|
||||
on: push
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
snapshot:
|
||||
image-name: custom-image
|
||||
version: 1.*
|
||||
if: ${{ github.event_name == 'something' }}
|
||||
|
||||
---
|
||||
{
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "build",
|
||||
"name": "build",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
],
|
||||
"snapshot": {
|
||||
"type": 2,
|
||||
"map": [
|
||||
{
|
||||
"Key": "image-name",
|
||||
"Value": "custom-image"
|
||||
},
|
||||
{
|
||||
"Key": "version",
|
||||
"Value": "1.*"
|
||||
},
|
||||
{
|
||||
"Key": "if",
|
||||
"Value": {
|
||||
"type": 3,
|
||||
"expr": "github.event_name == 'something'"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
include-source: false # Drop file/line/col from output
|
||||
---
|
||||
# on: push
|
||||
# jobs:
|
||||
# job1:
|
||||
# runs-on: windows-2019
|
||||
# snapshot: custom-image
|
||||
# steps:
|
||||
# - run: echo 1
|
||||
on: push
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
snapshot: custom-image
|
||||
---
|
||||
{
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "build",
|
||||
"name": "build",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
],
|
||||
"snapshot": "custom-image"
|
||||
}
|
||||
]
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
include-source: false
|
||||
skip:
|
||||
- C#
|
||||
- Go
|
||||
---
|
||||
on:
|
||||
image_version:
|
||||
names: testing
|
||||
versions: 1.*
|
||||
jobs:
|
||||
my-job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
---
|
||||
{
|
||||
"events": {
|
||||
"image_version": {
|
||||
"versions": [
|
||||
"1.*"
|
||||
],
|
||||
"names": [
|
||||
"testing"
|
||||
]
|
||||
}
|
||||
},
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "my-job",
|
||||
"name": "my-job",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
include-source: false
|
||||
skip:
|
||||
- C#
|
||||
- Go
|
||||
---
|
||||
on:
|
||||
image_version:
|
||||
types:
|
||||
- ready
|
||||
names:
|
||||
- one
|
||||
- two
|
||||
jobs:
|
||||
my-job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
---
|
||||
{
|
||||
"events": {
|
||||
"image_version": {
|
||||
"types": [
|
||||
"ready"
|
||||
],
|
||||
"names": [
|
||||
"one",
|
||||
"two"
|
||||
]
|
||||
}
|
||||
},
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "my-job",
|
||||
"name": "my-job",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
include-source: false
|
||||
skip:
|
||||
- C#
|
||||
- Go
|
||||
---
|
||||
on:
|
||||
image_version:
|
||||
types:
|
||||
- ready
|
||||
versions:
|
||||
- "1.0.0"
|
||||
- "1.0.1"
|
||||
jobs:
|
||||
my-job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
---
|
||||
{
|
||||
"events": {
|
||||
"image_version": {
|
||||
"types": [
|
||||
"ready"
|
||||
],
|
||||
"versions": [
|
||||
"1.0.0",
|
||||
"1.0.1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "my-job",
|
||||
"name": "my-job",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
include-source: false
|
||||
skip:
|
||||
- C#
|
||||
- Go
|
||||
---
|
||||
on: image_version
|
||||
jobs:
|
||||
my-job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
---
|
||||
{
|
||||
"events": {
|
||||
"image_version": {}
|
||||
},
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "my-job",
|
||||
"name": "my-job",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
include-source: false # Drop file/line/col from output
|
||||
---
|
||||
description: My workflow description
|
||||
on: push
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo hi
|
||||
---
|
||||
{
|
||||
"jobs": [
|
||||
{
|
||||
"type": "job",
|
||||
"id": "build",
|
||||
"name": "build",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"runs-on": "ubuntu-latest",
|
||||
"steps": [
|
||||
{
|
||||
"id": "__run",
|
||||
"if": {
|
||||
"type": 3,
|
||||
"expr": "success()"
|
||||
},
|
||||
"run": "echo hi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user