Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 45 additions & 25 deletions .github/workflows/opendata-instance-size-flexibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
# so the subscription only serves as an API routing scope.
permissions:
contents: write
pull-requests: write
id-token: write

jobs:
Expand Down Expand Up @@ -45,25 +44,11 @@ jobs:
shell: pwsh
run: src/scripts/Update-InstanceSizeFlexibility.ps1

- name: Create PR if data changed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: |
## Summary

Weekly automated update of instance size flexibility (ISF) ratios from the
[Azure Reservations Catalogs API](https://learn.microsoft.com/azure/cost-management-billing/reservations/instance-size-flexibility#extract-instance-size-flexibility-ratios-using-azure-catalogs-api).

This file maps each ARM SKU to its instance size flexibility group and ratio,
replacing the deprecated `AutofitComboMeterData.csv` and `isfratioblob.csv` files
that were hosted on `ccmstorageprod.blob.core.windows.net` (retired 30 Aug 2026).

## Test plan

- [ ] Review the diff for unexpected changes (large drops in group/SKU count, etc.)
- [ ] Spot-check a few SKUs against the Azure Pricing Calculator

🤖 Generated by the **Update Instance Size Flexibility** workflow
# GitHub Actions is not permitted to open pull requests in this org, so we push
# a branch and surface a one-click "create PR" link in the job summary for a
# maintainer to open. Opening the PR triggers Open Data CI and normal review.
# This mirrors opendata-commitment-eligibility.yml, which hit the same wall.
- name: Push branch and surface PR link if data changed
run: |
# Check for changes (handles both new file and modified file)
if git diff --quiet --exit-code -- src/open-data/InstanceSizeFlexibility.csv 2>/dev/null && \
Expand All @@ -72,15 +57,50 @@ jobs:
exit 0
fi

BRANCH="opendata/instance-size-flexibility-$(date +%Y%m%d)"
# run_number keeps a re-run on the same day from colliding with the branch an
# earlier run already pushed; run_attempt does the same for a re-run of this
# run, which keeps run_number and only increments the attempt.
BRANCH="opendata/instance-size-flexibility-$(date +%Y%m%d)-${{ github.run_number }}.${{ github.run_attempt }}"
git checkout -b "$BRANCH"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/open-data/InstanceSizeFlexibility.csv
git commit -m "chore: Update instance size flexibility ratios"
git push origin "$BRANCH"

gh pr create \
--title "[Open Data] Update instance size flexibility ratios ($(date +'%B %Y'))" \
--base dev \
--body "$PR_BODY"
PR_URL="${{ github.server_url }}/${{ github.repository }}/compare/dev...${BRANCH}?expand=1"
{
echo "### Instance size flexibility ratios updated"
echo ""
echo "Pushed branch \`${BRANCH}\`. GitHub Actions cannot open PRs in this repo, so open it manually:"
echo ""
echo "[**Create pull request →**](${PR_URL})"
echo ""
echo "Suggested title:"
echo ""
echo '```'
echo "[Open Data] Update instance size flexibility ratios ($(date +'%B %Y'))"
echo '```'
echo ""
echo "Suggested body:"
echo ""
echo '```markdown'
echo "## Summary"
echo ""
echo "Weekly automated update of instance size flexibility (ISF) ratios from the"
echo "[Azure Reservations Catalogs API](https://learn.microsoft.com/azure/cost-management-billing/reservations/instance-size-flexibility#extract-instance-size-flexibility-ratios-using-azure-catalogs-api)."
echo ""
echo "This file maps each ARM SKU to its instance size flexibility group and ratio,"
echo "replacing the deprecated \`AutofitComboMeterData.csv\` and \`isfratioblob.csv\` files"
echo "that were hosted on \`ccmstorageprod.blob.core.windows.net\` (retired 30 Aug 2026)."
echo ""
echo "## Test plan"
echo ""
echo "- [ ] Review the diff for unexpected changes (large drops in group/SKU count, etc.)"
echo "- [ ] Spot-check a few SKUs against the Azure Pricing Calculator"
echo ""
echo "🤖 Generated by the **Update Instance Size Flexibility** workflow"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
echo "Branch pushed: $BRANCH"
echo "Open a PR here: $PR_URL"
Loading