# Refactor GitHub Actions Workflow: Containerization Build
## 🛠 Summary
This PR introduces several important improvements and cleanups to the
build-containerization-template GitHub Actions workflow for better
maintainability, correctness, and readability.
### 🔧 Changes Made
#### 1. ✅ Fix invalid conditional syntax
- **!= is not supported in expressions** with **if**: in GitHub Actions.
- Only logical operators like !, &&, || are valid.
#### 2. ✅ Globalized environment variables
- Moved CURRENT_SDK and DEVELOPER_DIR to the job-level env: block to:
- Avoid redundancy across steps
- Make the workflow more maintainable
### 3. ✅ Replaced `secrets.GITHUB_TOKEN` with `github.token`
- Prefer github.token for GitHub-provided auth token to improve clarity
and scoping.
@katiewasnothere
This PR improves **safety and consistency** of the GitHub Actions
workflow (build-test-images.yml) file by:
- Using **[[ ... ]]** **instea**d of **[ ... ]** for conditionals.
- Adding **double quotes** around inputs and refs to **avoid**
evaluation issues.
This helps prevent bugs in **shell parsing**, especially with **empty or
misinterpreted** input values.
@katiewasnothere @wlan0
We eventually only want to support building docs from release branches
and tags, however, while we're working to initially set up the docs, we
may have some churn. So we want to be able to publish from main during
that churn.
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This adds branch protection to the workflow for building container test
images. This PR additionally moves the permissions for docs deploying to
be job level.
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>