Automated daily scanning of Docker image versions in blueprints using GitHub Actions Workflows (gh-aw) and Copilot.
-
Install gh-aw extension:
gh extension install github/gh-aw
-
Verify installation:
gh aw --help
The workflow is defined in .github/workflows/daily-version-scan.md in gh-aw format.
Compile to GitHub Actions YAML:
gh aw compile .github/workflows/daily-version-scan.mdThis generates .github/workflows/daily-version-scan.lock.yml which is the actual workflow file.
Configure GitHub secrets for API authentication:
# GitHub token (automatically provided, but can be customized)
gh secret set GH_AW_GITHUB_TOKEN --body "ghp_your_token_here"
# Docker Hub token (optional, increases rate limit from 100 to 200 pulls/6hr)
gh secret set DOCKER_HUB_TOKEN --body "dckr_pat_your_token_here"Note: Docker Hub token is optional but recommended to avoid rate limiting.
Both the source .md and compiled .lock.yml should be committed:
git add .github/workflows/daily-version-scan.md
git add .github/workflows/daily-version-scan.lock.yml
git commit -m "chore: add daily version scanner workflow"
git pushTest the workflow manually:
gh aw run daily-version-scanOr via GitHub UI:
- Go to Actions tab
- Select "Daily Version Scanner"
- Click "Run workflow"
Workflow runs automatically every day at 8:00 AM UTC (defined in on.schedule.cron).
- Scans all
blueprints/*/docker-compose.ymlfiles - Extracts image names and current versions
- Cross-references with
meta.jsonfor metadata
For each template:
- Docker Hub API: Query latest stable version
GET https://hub.docker.com/v2/repositories/{org}/{image}/tags?page_size=25&ordering=last_updated - GitHub Releases API: If GitHub link in meta.json
GET /repos/{owner}/{repo}/releases/latest
For outdated templates, creates issue:
Title: Update [app-name] to version [new-version]
Body:
## Current Version
- Current: 10.2.0
- Latest: 10.3.1
## Links
- Changelog: [link]
- Release Notes: [link]
- Docker Hub: https://hub.docker.com/r/grafana/grafana
## Update Checklist
- [ ] Update docker-compose.yml
- [ ] Update meta.json
- [ ] Test in staging
- [ ] Run validation
- [ ] Update README if breaking changes
- [ ] Run tests
Labels: template-update, automated
Before creating issue:
- Searches for existing open issues with
template-updatelabel for same app - If found, adds comment with new version info instead of creating duplicate
Posts workflow run summary with table:
| Template | Current | Latest | Status |
|----------|---------|--------|--------|
| grafana | 10.2.0 | 10.3.1 | ⚠️ Update Available |
| redis | 7.2.0 | 7.2.0 | ✅ Up to date |
| pocketbase | latest | — | ⚠️ Unversioned |- Maximum 10 issues per run: Prevents spam
- Semver increases only: No downgrades reported
- Rate limits: Respects Docker Hub (200/6hr) and GitHub (5000/hr) API limits
- Stable versions only: Excludes
latest,dev,rc,beta,alphatags
GITHUB_TOKEN: Auto-provided by GitHub Actions (read issues, write issues)DOCKER_HUB_TOKEN: Optional, stored in GitHub Secrets (never exposed)
Workflow has minimal permissions:
permissions:
contents: read
issues: writeCannot modify code or push commits - only read templates and create issues.
Check:
- Compiled
.lock.ymlexists in.github/workflows/ - Both
.mdand.lock.ymlare committed - Workflow is enabled in repository settings
Solution:
- Set
DOCKER_HUB_TOKENsecret (increases limit to 200/6hr) - Reduce scan frequency (change cron schedule)
Possible reasons:
- All templates are up-to-date ✅
- Templates use
latesttag (skipped by design) - Deduplication found existing issues (check for open
template-updateissues)
The scanner prioritizes stable semver tags. If detecting wrong version:
- Check Docker Hub API response manually
- Verify image tag naming convention
- Update scanner logic in workflow to handle special cases
Edit on.schedule.cron in .github/workflows/daily-version-scan.md:
on:
schedule:
- cron: "0 8 * * *" # 8 AM UTC daily
# Change to:
- cron: "0 */12 * * *" # Every 12 hoursThen recompile:
gh aw compile .github/workflows/daily-version-scan.md
git add .github/workflows/daily-version-scan.{md,lock.yml}
git commit -m "chore: update version scan schedule"Modify the workflow markdown, then recompile:
# Edit workflow
vim .github/workflows/daily-version-scan.md
# Recompile
gh aw compile .github/workflows/daily-version-scan.md
# Verify changes
git diff .github/workflows/daily-version-scan.lock.yml
# Commit
git add .github/workflows/daily-version-scan.{md,lock.yml}
git commit -m "chore: customize version scanner logic"# List recent runs
gh run list --workflow=daily-version-scan.lock.yml
# View specific run
gh run view <run-id>
# View logs
gh run view <run-id> --log- Go to repository Actions tab
- Select "Daily Version Scanner" workflow
- View run history and logs
When version scanner creates an issue:
- Manual Update: Developer updates template and closes issue
- Copilot Update: Assign
@copilotto issue for automated PR creation - Dependabot-style: Future enhancement - auto-create PRs (requires additional workflow)
- Workflow source:
.github/workflows/daily-version-scan.md - Compiled workflow:
.github/workflows/daily-version-scan.lock.yml - gh-aw docs: https://github.com/github/gh-aw
- Docker Hub API: https://docs.docker.com/docker-hub/api/latest/
- GitHub REST API: https://docs.github.com/en/rest