Azure Pipeline Variable List
A tool to analyze and list variables used in Azure Pipeline YAML files.
功能说明
一个用于分析和列出 Azure Pipeline YAML 文件中使用的变量的工具。
功能特点
- 检测
$(VARIABLE)格式的变量 - 识别变量组中定义的变量
- 支持嵌套目录结构
- 支持
.yml和.yaml文件扩展名
例如,如果你有一个 demo.yml 流水线文件,内容如下:
...
variables:
group: infra
## - var1
## - var2
## - var3
stages:
- stage: Build
jobs:
- job: Build
steps:
- script: echo $(var1)
...
azpipvar 将输出:
demo.yml:
- var1 (by variable group)
使用说明:
## - var3
这是一个注释,告诉工具 var3 是在变量组中定义的,或者是在 Azure DevOps 流水线的变量中定义的(未存储在代码仓库中)。
该工具将列出流水线文件中使用的所有变量,并显示它们是否在变量组中定义。
这个工具可以帮助你找到流水线文件中所有未预定义的变量。
Features
- Detects variables in
$(VARIABLE)format - Identifies variables defined in variable groups
- Supports nested directory structures
- Handles both
.ymland.yamlfile extensions
For example, if you have a pipeline file demo.yml like this:
...
variables:
group: infra
## - var1
## - var2
## - var3
stages:
- stage: Build
jobs:
- job: Build
steps:
- script: echo $(var1)
...
azpipvar will output:
demo.yml:
- var1 (by variable group)
Let me explain the usage:
## - var3
This is a comment, that tells the tool that var3 is defined in a variable group or just defined in the variables of the azure devops pipeline(which is not stored in repository).
It will list all variables used in the pipeline files and show whether they are defined in variable groups or not.
This tool can help you find all variables used in the pipeline files that is not predefined.
Requirements
- Python 3.8 or higher
- PyYAML 6.0.1 or higher
Installation
You can install the package using pip:
pip install azpipvar
To help us improve the package by sharing anonymous installation statistics:
pip install azpipvar --install-option="--no-track-install"
Note: The installation tracking is completely optional and transparent. When enabled:
- A single GET request is made to count the installation
- No personal or system information is collected
- Failed tracking attempts will not affect installation
- The tracking server timeout is set to 2 seconds
For development installation from source:
git clone https://github.com/greatbody/macpy-scripts.git
cd macpy-scripts
pip install -e .
Usage
Navigate to your Azure Pipelines directory and run:
azpipvar
This will scan all YAML files in the current directory and subdirectories, listing all variables used in the pipeline files.
License
This project is licensed under the MIT License.
Author
- greatbody (sunruicode@gmail.com)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for azpipvar 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azpipvar-0.1.6.tar.gz | 5.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azpipvar-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / azpipvar-0.1.6.tar.gz
| Download URL | azpipvar-0.1.6.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
300376f8561e553aeda2deb576dbf1f686c818b3260da6c0b085b11f8b3871ee
|
|
BLAKE2b-256 checksum How to use checksums |
115a761f0093d36000861cf213d8c9db23d33a177c7eabd8460a3bf45ae8d9cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / azpipvar-0.1.6-py3-none-any.whl
| Download URL | azpipvar-0.1.6-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0ccfac4f5c48475eeac5c49cd537ce0a58b13016da747ae2976a4909f8029bb
|
|
BLAKE2b-256 checksum How to use checksums |
33e3e70396c0081454fe8b01bbb7748d43d3d96edb8c585c3887c58ca0a14487
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for azpipvar 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.