[Open Data] Fix ISF ratio scale, region coverage and culture handling, and keep retired-SKU reservations visible #100
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Open Data CI | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| paths: | |
| - 'src/open-data/*.csv' | |
| - 'src/open-data/*.json' | |
| # Internal operational baselines for the eligibility completeness guard, not | |
| # reference data; Build-OpenData ignores them, so they shouldn't trigger CI. | |
| - '!src/open-data/*.familycounts.json' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| statuses: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| CI_COMMIT_MESSAGE: Generate PowerShell commands for open data | |
| CI_COMMIT_AUTHOR: Open Data CI | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| - name: Set environment variable "commit-message" | |
| run: echo "commit-message=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV | |
| - name: Set environment variable "build_url" | |
| run: echo "build_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV | |
| - name: Set environment variable "commit-author" | |
| run: echo "commit-author=$(git log -1 --pretty=format:'%an')" >> $GITHUB_ENV | |
| - name: Set environment variable "is-auto-commit" | |
| if: env.commit-message == env.CI_COMMIT_MESSAGE && env.commit-author == env.CI_COMMIT_AUTHOR | |
| run: echo "is-auto-commit=true" >> $GITHUB_ENV | |
| - name: Build Open Data | |
| if: env.is-auto-commit == false | |
| shell: pwsh | |
| run: | | |
| src/scripts/Build-OpenData.ps1 -PowerShell | |
| if (git status --porcelain) | |
| { | |
| git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | |
| git config --global user.email "finopstoolkit@users.noreply.github.com" | |
| git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" | |
| git push | |
| } | |
| # Build-OpenData.ps1 -Test calls Test-PowerShell.ps1, which requires Pester 6 (#2254): | |
| # the suite uses -AllowNullOrEmptyForEach, which Pester 5 rejects. The ubuntu runner | |
| # image ships Pester 5.9.0, so the minimum has to be installed explicitly. This is the | |
| # same command Init-Repo.ps1 runs and the one Test-PowerShell.ps1 names in its error. | |
| # dev.yml pins the same floor through psmodulecache, which this repo only uses on | |
| # Windows runners. | |
| - name: Install Pester | |
| shell: pwsh | |
| run: Install-Module -Name Pester -MinimumVersion 6.0.0 -Scope CurrentUser -Repository PSGallery -Force | |
| - name: Test Open Data | |
| id: test | |
| shell: pwsh | |
| run: | | |
| src/scripts/Build-OpenData.ps1 -Test | |
| - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| if: failure() | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '⚠️ Open Data CI task failed: ${{ env.build_url }}' | |
| }) |