mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 11:07:02 +00:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
4
.github/copilot-instructions.md
vendored
4
.github/copilot-instructions.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Scope and goals
|
## Scope and goals
|
||||||
|
|
||||||
- This repository serves as the source for building GitHub Actions runner and Azure DevOps agent images for Windows, Ubuntu, and macOS. You can find exact versions in the [README.md](../README.md#available-images) available images section. Windows and Ubuntu images build on Azure infrastructure using Packer; macOS images use Anka virtualization.
|
- This repository serves as the source for building GitHub Actions runner and Azure DevOps agent images for Windows, Ubuntu, and macOS. You can find exact versions in the [Available Images](../README.md#available-images) section of README.md. Windows and Ubuntu images build on Azure infrastructure using Packer; macOS images use Anka virtualization.
|
||||||
- Emphasize best practices for contributing to open-source projects, including code style, commit messages, and pull request etiquette.
|
- Emphasize best practices for contributing to open-source projects, including code style, commit messages, and pull request etiquette.
|
||||||
- Prefer clarity and correctness over creativity. If information is missing, ask clarifying questions or insert TODOs instead of guessing.
|
- Prefer clarity and correctness over creativity. If information is missing, ask clarifying questions or insert TODOs instead of guessing.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- Follow the code style guide in [CONTRIBUTING.md](../CONTRIBUTING.md#code-style-guide) for Bash and PowerShell scripts, including naming conventions, file structure, and indentation rules.
|
- Follow the code style guide in [CONTRIBUTING.md](../CONTRIBUTING.md#code-style-guide) for Bash and PowerShell scripts, including naming conventions, file structure, and indentation rules.
|
||||||
- Focus on re-using helpers when writing scripts. Windows, Linux and Ubuntu scripts have helper functions available to simplify installation and validation.
|
- Focus on re-using helpers when writing scripts. Windows, Linux and Ubuntu scripts have helper functions available to simplify installation and validation.
|
||||||
- Always confirm versions and installations paths against existing toolset files and installation scripts.
|
- Always confirm versions and installation paths against existing toolset files and installation scripts.
|
||||||
|
|
||||||
## Output format
|
## Output format
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Each script should start with the following shebang:
|
|||||||
|
|
||||||
This will make the script exit if any command fails.
|
This will make the script exit if any command fails.
|
||||||
|
|
||||||
After the shebang, add a header with of the following format:
|
After the shebang, add a header with the following format:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -124,7 +124,7 @@ source $HELPER_SCRIPTS/install.sh
|
|||||||
source $HELPER_SCRIPTS/etc-environment.sh
|
source $HELPER_SCRIPTS/etc-environment.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
For mac OS:
|
For macOS:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
@@ -153,15 +153,15 @@ After that, add the script code.
|
|||||||
- `curl -sSLf`
|
- `curl -sSLf`
|
||||||
- `wget -qO-`
|
- `wget -qO-`
|
||||||
|
|
||||||
### Powershell scripts
|
### PowerShell scripts
|
||||||
|
|
||||||
#### Naming convention for Powershell scripts
|
#### Naming convention for PowerShell scripts
|
||||||
|
|
||||||
- Use camelCase for variable names.
|
- Use camelCase for variable names.
|
||||||
- Use uppercase letters for constants.
|
- Use uppercase letters for constants.
|
||||||
- Use `Verb-Noun` and PascalCase for function names.
|
- Use `Verb-Noun` and PascalCase for function names.
|
||||||
|
|
||||||
### Powershell script structure
|
### PowerShell script structure
|
||||||
|
|
||||||
Each script should start with the following header:
|
Each script should start with the following header:
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ Import-Module "$env:HOME/image-generation/helpers/Xcode.Helpers.psm1" -DisableNa
|
|||||||
|
|
||||||
After that, add the script code.
|
After that, add the script code.
|
||||||
|
|
||||||
### Indentations and line breaks in Powershell scripts
|
### Indentations and line breaks in PowerShell scripts
|
||||||
|
|
||||||
- Use 4 spaces for indentation.
|
- Use 4 spaces for indentation.
|
||||||
- Use 1 space between `if`/`elseif`/`foreach` and `(` but not between `(` and the condition.
|
- Use 1 space between `if`/`elseif`/`foreach` and `(` but not between `(` and the condition.
|
||||||
|
|||||||
Reference in New Issue
Block a user