64aae8a102
Add support for the 'deployment' boolean property under 'environment:' in workflow YAML. When set to false, the job accesses environment protection rules and secrets without creating a deployment record. Changes: - Add 'deployment' to job-environment-mapping schema (workflow-v1.0.json) - Add 'deployment' to ActionsEnvironmentReference type - Add feature-gated parsing in environment converter - Add 'allowDeploymentKeyword' experimental feature flag - Add xlang test data for enabled/disabled feature flag scenarios
93 lines
1.6 KiB
YAML
93 lines
1.6 KiB
YAML
include-source: false # Drop file/line/col from output
|
|
skip:
|
|
- C#
|
|
allow-deployment-keyword: true
|
|
---
|
|
on: push
|
|
jobs:
|
|
build:
|
|
environment:
|
|
name: production
|
|
deployment: false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo hi
|
|
build2:
|
|
environment:
|
|
name: staging
|
|
deployment: true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo hi
|
|
---
|
|
{
|
|
"jobs": [
|
|
{
|
|
"type": "job",
|
|
"id": "build",
|
|
"name": "build",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"environment": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "name",
|
|
"Value": "production"
|
|
},
|
|
{
|
|
"Key": "deployment",
|
|
"Value": false
|
|
}
|
|
]
|
|
},
|
|
"runs-on": "ubuntu-latest",
|
|
"steps": [
|
|
{
|
|
"id": "__run",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"run": "echo hi"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "job",
|
|
"id": "build2",
|
|
"name": "build2",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"environment": {
|
|
"type": 2,
|
|
"map": [
|
|
{
|
|
"Key": "name",
|
|
"Value": "staging"
|
|
},
|
|
{
|
|
"Key": "deployment",
|
|
"Value": true
|
|
}
|
|
]
|
|
},
|
|
"runs-on": "ubuntu-latest",
|
|
"steps": [
|
|
{
|
|
"id": "__run",
|
|
"if": {
|
|
"type": 3,
|
|
"expr": "success()"
|
|
},
|
|
"run": "echo hi"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|