148 lines
2.9 KiB
YAML
148 lines
2.9 KiB
YAML
include-source: false # Drop file/line/col from output
|
|
skip:
|
|
- Go
|
|
---
|
|
on: push
|
|
jobs:
|
|
# Mapping
|
|
build:
|
|
uses: contoso/templates/.github/workflows/build.yml@v1
|
|
secrets:
|
|
secret1: ${{ secrets.foo }}
|
|
|
|
# Inherit
|
|
build2:
|
|
uses: contoso/templates/.github/workflows/build.yml@v1
|
|
secrets: inherit
|
|
---
|
|
contoso/templates/.github/workflows/build.yml@v1
|
|
---
|
|
on:
|
|
workflow_call:
|
|
secrets:
|
|
secret1:
|
|
required: true
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo 1
|
|
---
|
|
{
|
|
"jobs": [
|
|
{
|
|
"type": "reusableWorkflowJob",
|
|
"id": "build",
|
|
"name": "build",
|
|
"needs": [],
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"ref": "contoso/templates/.github/workflows/build.yml@v1",
|
|
"secret-definitions": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "secret1",
|
|
"Value": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "required",
|
|
"Value": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"secret-values": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "secret1",
|
|
"Value": {
|
|
"type": 3,
|
|
"expr": "secrets.foo"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"jobs": [
|
|
{
|
|
"type": "job",
|
|
"id": "deploy",
|
|
"name": "deploy",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"runs-on": "ubuntu-latest",
|
|
"steps": [
|
|
{
|
|
"id": "__run",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"run": "echo 1"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "reusableWorkflowJob",
|
|
"id": "build2",
|
|
"name": "build2",
|
|
"needs": [],
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"ref": "contoso/templates/.github/workflows/build.yml@v1",
|
|
"secret-definitions": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "secret1",
|
|
"Value": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "required",
|
|
"Value": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"inherit-secrets": true,
|
|
"jobs": [
|
|
{
|
|
"type": "job",
|
|
"id": "deploy",
|
|
"name": "deploy",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"runs-on": "ubuntu-latest",
|
|
"steps": [
|
|
{
|
|
"id": "__run",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"run": "echo 1"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|