1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

feat: the forge context is equivalent to the github context

This commit is contained in:
Earl Warren 2025-07-05 23:40:01 +02:00
parent 7ef85d2a14
commit 062e57b1c7
2 changed files with 45 additions and 21 deletions

View file

@ -150,6 +150,7 @@
}, },
"output-value": { "output-value": {
"context": [ "context": [
"forge",
"github", "github",
"strategy", "strategy",
"matrix", "matrix",
@ -163,6 +164,7 @@
}, },
"input-default-context": { "input-default-context": {
"context": [ "context": [
"forge",
"github", "github",
"strategy", "strategy",
"matrix", "matrix",
@ -179,6 +181,7 @@
}, },
"string-steps-context": { "string-steps-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"strategy", "strategy",
@ -193,6 +196,7 @@
}, },
"boolean-steps-context": { "boolean-steps-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"strategy", "strategy",
@ -207,6 +211,7 @@
}, },
"step-env": { "step-env": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"strategy", "strategy",
@ -224,6 +229,7 @@
}, },
"step-if": { "step-if": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"strategy", "strategy",
@ -242,6 +248,7 @@
}, },
"step-with": { "step-with": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"strategy", "strategy",

View file

@ -50,7 +50,7 @@
"boolean": {} "boolean": {}
}, },
"run-name": { "run-name": {
"context": ["github", "inputs", "vars"], "context": ["forge", "github", "inputs", "vars"],
"string": {}, "string": {},
"description": "The name for workflow runs generated from the workflow. GitHub displays the workflow run name in the list of workflow runs on your repository's 'Actions' tab.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#run-name)" "description": "The name for workflow runs generated from the workflow. GitHub displays the workflow run name in the list of workflow runs on your repository's 'Actions' tab.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#run-name)"
}, },
@ -1137,7 +1137,7 @@
}, },
"workflow-call-input-default": { "workflow-call-input-default": {
"description": "If a `default` parameter is not set, the default value of the input is `false` for boolean, `0` for a number, and `\"\"` for a string.", "description": "If a `default` parameter is not set, the default value of the input is `false` for boolean, `0` for a number, and `\"\"` for a string.",
"context": ["github", "inputs", "vars"], "context": ["forge", "github", "inputs", "vars"],
"one-of": ["string", "boolean", "number"] "one-of": ["string", "boolean", "number"]
}, },
"workflow-call-secrets": { "workflow-call-secrets": {
@ -1199,7 +1199,7 @@
}, },
"workflow-output-context": { "workflow-output-context": {
"description": "The value to assign to the output parameter.", "description": "The value to assign to the output parameter.",
"context": ["github", "inputs", "vars", "jobs"], "context": ["forge", "github", "inputs", "vars", "jobs"],
"string": {} "string": {}
}, },
"workflow-dispatch-string": { "workflow-dispatch-string": {
@ -1400,7 +1400,7 @@
}, },
"workflow-env": { "workflow-env": {
"description": "A map of environment variables that are available to the steps of all jobs in the workflow. You can also set environment variables that are only available to the steps of a single job or to a single step.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#env)", "description": "A map of environment variables that are available to the steps of all jobs in the workflow. You can also set environment variables that are only available to the steps of a single job or to a single step.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#env)",
"context": ["github", "inputs", "vars", "secrets"], "context": ["forge", "github", "inputs", "vars", "secrets"],
"mapping": { "mapping": {
"loose-key-type": "non-empty-string", "loose-key-type": "non-empty-string",
"loose-value-type": "string" "loose-value-type": "string"
@ -1509,6 +1509,7 @@
"job-if": { "job-if": {
"description": "You can use the `if` conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.", "description": "You can use the `if` conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.",
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1524,6 +1525,7 @@
}, },
"job-if-result": { "job-if-result": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1537,7 +1539,7 @@
}, },
"strategy": { "strategy": {
"description": "Use `strategy` to use a matrix strategy for your jobs. A matrix strategy lets you use variables in a single job definition to automatically create multiple job runs that are based on the combinations of the variables. ", "description": "Use `strategy` to use a matrix strategy for your jobs. A matrix strategy lets you use variables in a single job definition to automatically create multiple job runs that are based on the combinations of the variables. ",
"context": ["github", "inputs", "vars", "needs"], "context": ["forge", "github", "inputs", "vars", "needs"],
"mapping": { "mapping": {
"properties": { "properties": {
"fail-fast": { "fail-fast": {
@ -1582,7 +1584,7 @@
}, },
"runs-on": { "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`.", "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": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": [ "one-of": [
"non-empty-string", "non-empty-string",
"sequence-of-non-empty-string", "sequence-of-non-empty-string",
@ -1607,6 +1609,7 @@
"job-env": { "job-env": {
"description": "A map of variables that are available to all steps in the job.", "description": "A map of variables that are available to all steps in the job.",
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1622,12 +1625,12 @@
}, },
"workflow-concurrency": { "workflow-concurrency": {
"description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression.\n\nYou can also specify `concurrency` at the job level.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)", "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression.\n\nYou can also specify `concurrency` at the job level.\n\n[Documentation](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)",
"context": ["github", "inputs", "vars"], "context": ["forge", "github", "inputs", "vars"],
"one-of": ["string", "concurrency-mapping"] "one-of": ["string", "concurrency-mapping"]
}, },
"job-concurrency": { "job-concurrency": {
"description": "Concurrency ensures that only a single job using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the `secrets` context.\n\nYou can also specify `concurrency` at the workflow level.", "description": "Concurrency ensures that only a single job using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the `secrets` context.\n\nYou can also specify `concurrency` at the workflow level.",
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": ["non-empty-string", "concurrency-mapping"] "one-of": ["non-empty-string", "concurrency-mapping"]
}, },
"concurrency-mapping": { "concurrency-mapping": {
@ -1648,7 +1651,7 @@
}, },
"job-environment": { "job-environment": {
"description": "The environment that the job references. All environment protection rules must pass before a job referencing the environment is sent to a runner.", "description": "The environment that the job references. All environment protection rules must pass before a job referencing the environment is sent to a runner.",
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": ["string", "job-environment-mapping"] "one-of": ["string", "job-environment-mapping"]
}, },
"job-environment-mapping": { "job-environment-mapping": {
@ -1667,7 +1670,7 @@
}, },
"job-environment-name": { "job-environment-name": {
"description": "The name of the environment used by the job.", "description": "The name of the environment used by the job.",
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"string": {} "string": {}
}, },
"job-defaults": { "job-defaults": {
@ -1680,6 +1683,7 @@
}, },
"job-defaults-run": { "job-defaults-run": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1755,6 +1759,7 @@
}, },
"step-continue-on-error": { "step-continue-on-error": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1779,6 +1784,7 @@
}, },
"step-if": { "step-if": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1802,6 +1808,7 @@
}, },
"step-if-result": { "step-if-result": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1822,6 +1829,7 @@
"step-env": { "step-env": {
"description": "Sets variables for steps to use in the runner environment. You can also set variables for the entire workflow or a job.", "description": "Sets variables for steps to use in the runner environment. You can also set variables for the entire workflow or a job.",
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1842,6 +1850,7 @@
}, },
"step-name": { "step-name": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1860,6 +1869,7 @@
}, },
"step-timeout-minutes": { "step-timeout-minutes": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1879,6 +1889,7 @@
"step-with": { "step-with": {
"description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as variables. When you specify an input in a workflow file or use a default input value, GitHub creates a variable for the input with the name `INPUT_<VARIABLE_NAME>`. The variable created converts input names to uppercase letters and replaces spaces with `_`.", "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as variables. When you specify an input in a workflow file or use a default input value, GitHub creates a variable for the input with the name `INPUT_<VARIABLE_NAME>`. The variable created converts input names to uppercase letters and replaces spaces with `_`.",
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1899,7 +1910,7 @@
}, },
"container": { "container": {
"description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\n\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.", "description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\n\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.",
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": ["string", "container-mapping"] "one-of": ["string", "container-mapping"]
}, },
"container-mapping": { "container-mapping": {
@ -1932,19 +1943,19 @@
}, },
"services": { "services": {
"description": "Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers. When you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network. When both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name. When a step does not use a container action, you must access the service using localhost and bind the ports.", "description": "Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers. When you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network. When both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name. When a step does not use a container action, you must access the service using localhost and bind the ports.",
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"mapping": { "mapping": {
"loose-key-type": "non-empty-string", "loose-key-type": "non-empty-string",
"loose-value-type": "services-container" "loose-value-type": "services-container"
} }
}, },
"services-container": { "services-container": {
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": ["non-empty-string", "container-mapping"] "one-of": ["non-empty-string", "container-mapping"]
}, },
"container-registry-credentials": { "container-registry-credentials": {
"description": "If the image's container registry requires authentication to pull the image, you can use `jobs.<job_id>.container.credentials` to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command.", "description": "If the image's container registry requires authentication to pull the image, you can use `jobs.<job_id>.container.credentials` to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command.",
"context": ["github", "inputs", "vars", "secrets", "env"], "context": ["forge", "github", "inputs", "vars", "secrets", "env"],
"mapping": { "mapping": {
"properties": { "properties": {
"username": "non-empty-string", "username": "non-empty-string",
@ -1970,23 +1981,24 @@
} }
}, },
"boolean-needs-context": { "boolean-needs-context": {
"context": ["github", "inputs", "vars", "needs"], "context": ["forge", "github", "inputs", "vars", "needs"],
"boolean": {} "boolean": {}
}, },
"number-needs-context": { "number-needs-context": {
"context": ["github", "inputs", "vars", "needs"], "context": ["forge", "github", "inputs", "vars", "needs"],
"number": {} "number": {}
}, },
"string-needs-context": { "string-needs-context": {
"context": ["github", "inputs", "vars", "needs"], "context": ["forge", "github", "inputs", "vars", "needs"],
"string": {} "string": {}
}, },
"scalar-needs-context": { "scalar-needs-context": {
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"one-of": ["string", "boolean", "number"] "one-of": ["string", "boolean", "number"]
}, },
"scalar-needs-context-with-secrets": { "scalar-needs-context-with-secrets": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -1998,19 +2010,20 @@
"one-of": ["string", "boolean", "number"] "one-of": ["string", "boolean", "number"]
}, },
"boolean-strategy-context": { "boolean-strategy-context": {
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"boolean": {} "boolean": {}
}, },
"number-strategy-context": { "number-strategy-context": {
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"number": {} "number": {}
}, },
"string-strategy-context": { "string-strategy-context": {
"context": ["github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "github", "inputs", "vars", "needs", "strategy", "matrix"],
"string": {} "string": {}
}, },
"boolean-steps-context": { "boolean-steps-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -2028,6 +2041,7 @@
}, },
"number-steps-context": { "number-steps-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -2045,6 +2059,7 @@
}, },
"string-runner-context": { "string-runner-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -2061,6 +2076,7 @@
}, },
"string-runner-context-no-secrets": { "string-runner-context-no-secrets": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",
@ -2076,6 +2092,7 @@
}, },
"string-steps-context": { "string-steps-context": {
"context": [ "context": [
"forge",
"github", "github",
"inputs", "inputs",
"vars", "vars",