Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Comment on OpenData CI Failure #1301

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/workflows/opendata-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
contents: write
pull-requests: write
statuses: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -22,6 +23,8 @@ jobs:
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"
Expand All @@ -40,6 +43,18 @@ jobs:
git push
}
- name: Test Open Data
id: test
shell: pwsh
run: |
src/scripts/Build-OpenData.ps1 -Test
- uses: actions/github-script@v7
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 }}'
})
1 change: 1 addition & 0 deletions src/open-data/Regions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,4 @@ za north,southafricanorth,South Africa North
za west,southafricawest,South Africa West
zanorth,southafricanorth,South Africa North
zawest,southafricawest,South Africa West
test,test,test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

1 change: 1 addition & 0 deletions src/powershell/Private/Get-OpenDataRegion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,6 @@ function Get-OpenDataRegion
,[PSCustomObject]@{ OriginalValue = 'za west'; RegionId = 'southafricawest'; RegionName = 'South Africa West'; }
,[PSCustomObject]@{ OriginalValue = 'zanorth'; RegionId = 'southafricanorth'; RegionName = 'South Africa North'; }
,[PSCustomObject]@{ OriginalValue = 'zawest'; RegionId = 'southafricawest'; RegionName = 'South Africa West'; }
,[PSCustomObject]@{ OriginalValue = 'test'; RegionId = 'test'; RegionName = 'test'; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

)
}
1 change: 1 addition & 0 deletions src/scripts/Test-PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ param (
$RunFailed
)

throw "testing"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

# Select tests to run
if ($RunFailed)
{
Expand Down
Loading