Files
languageservices/actions-workflow-parser/testdata/reader/reusable-workflow-job-basic.yml
T
2023-01-06 15:54:31 -08:00

295 lines
6.1 KiB
YAML

include-source: false # Drop file/line/col from output
skip:
- Go
- TypeScript
---
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo hi
deploy-1:
needs: build
uses: contoso/templates/.github/workflows/deploy.yml@v1
with:
app_name: my app
secrets: # mapping
shh: ${{ secrets.my_secret }}
deploy-2:
needs: build
uses: contoso/templates/.github/workflows/deploy.yml@v1
with:
app_name: my app
secrets: inherit # inherit
---
contoso/templates/.github/workflows/deploy.yml@v1
---
on:
workflow_call:
inputs:
app_name:
required: true
type: string
secrets:
shh: # required
required: true
shh2: # null
jobs:
job1:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.test }}
steps:
- run: echo \""::set-output name=test::hello\""
---
{
"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"
}
]
},
{
"Type": "reusableWorkflowJob",
"Id": "deploy-1",
"Name": "deploy-1",
"Needs": [
"build"
],
"If": {
"type": 3,
"expr": "success()"
},
"Ref": "contoso/templates/.github/workflows/deploy.yml@v1",
"Permissions": null,
"InputDefinitions": {
"type": 2,
"map": [
{
"Key": "app_name",
"Value": {
"type": 2,
"map": [
{
"Key": "required",
"Value": true
},
{
"Key": "type",
"Value": "string"
}
]
}
}
]
},
"InputValues": {
"type": 2,
"map": [
{
"Key": "app_name",
"Value": "my app"
}
]
},
"SecretDefinitions": {
"type": 2,
"map": [
{
"Key": "shh",
"Value": {
"type": 2,
"map": [
{
"Key": "required",
"Value": true
}
]
}
},
{
"Key": "shh2",
"Value": null
}
]
},
"SecretValues": {
"type": 2,
"map": [
{
"Key": "shh",
"Value": {
"type": 3,
"expr": "secrets.my_secret"
}
}
]
},
"InheritSecrets": false,
"Outputs": null,
"Defaults": null,
"Env": null,
"Concurrency": null,
"EmbeddedConcurrency": null,
"Strategy": null,
"Jobs": [
{
"type": "job",
"id": "job1",
"name": "job1",
"if": {
"type": 3,
"expr": "success()"
},
"runs-on": "ubuntu-latest",
"outputs": {
"type": 2,
"map": [
{
"Key": "output1",
"Value": {
"type": 3,
"expr": "steps.step1.outputs.test"
}
}
]
},
"steps": [
{
"id": "__run",
"if": {
"type": 3,
"expr": "success()"
},
"run": "echo \\\"\"::set-output name=test::hello\\\"\""
}
]
}
]
},
{
"Type": "reusableWorkflowJob",
"Id": "deploy-2",
"Name": "deploy-2",
"Needs": [
"build"
],
"If": {
"type": 3,
"expr": "success()"
},
"Ref": "contoso/templates/.github/workflows/deploy.yml@v1",
"Permissions": null,
"InputDefinitions": {
"type": 2,
"map": [
{
"Key": "app_name",
"Value": {
"type": 2,
"map": [
{
"Key": "required",
"Value": true
},
{
"Key": "type",
"Value": "string"
}
]
}
}
]
},
"InputValues": {
"type": 2,
"map": [
{
"Key": "app_name",
"Value": "my app"
}
]
},
"SecretDefinitions": {
"type": 2,
"map": [
{
"Key": "shh",
"Value": {
"type": 2,
"map": [
{
"Key": "required",
"Value": true
}
]
}
},
{
"Key": "shh2",
"Value": null
}
]
},
"SecretValues": null,
"InheritSecrets": true,
"Outputs": null,
"Defaults": null,
"Env": null,
"Concurrency": null,
"EmbeddedConcurrency": null,
"Strategy": null,
"Jobs": [
{
"type": "job",
"id": "job1",
"name": "job1",
"if": {
"type": 3,
"expr": "success()"
},
"runs-on": "ubuntu-latest",
"outputs": {
"type": 2,
"map": [
{
"Key": "output1",
"Value": {
"type": 3,
"expr": "steps.step1.outputs.test"
}
}
]
},
"steps": [
{
"id": "__run",
"if": {
"type": 3,
"expr": "success()"
},
"run": "echo \\\"\"::set-output name=test::hello\\\"\""
}
]
}
]
}
]
}