Skip to content

add check csv-header to github CI #130

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

Merged
merged 4 commits into from
May 11, 2025
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
42 changes: 42 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
smoke-test:
strategy:
fail-fast: false
matrix:
args:
- "--invites"
Expand Down Expand Up @@ -51,3 +52,44 @@ jobs:

- name: Show out.csv
run: cat out.csv

- name: Check header in first line
run: |
case "${{ matrix.args }}" in
--invites)
HEADER="repository name,invited login,invite creation date,invitation url"
;;
--commits)
HEADER="repository name,author name,author login,author email,date and time,changed files,commit id,branch"
;;
--pull_requests)
HEADER="repository name,title,id,state,commit into,commit from,created at,creator name,creator login,creator email,changed files,comment body,comment created at,comment author name,comment author login,comment author email,merger name,merger login,merger email,source branch,target branch,assignee story,related issues,labels,milestone"
;;
--issues)
HEADER="repository name,number,title,state,task,created at,creator name,creator login,creator email,closer name,closer login,closer email,closed at,comment body,comment created at,comment author name,comment author login,comment author email,assignee story,connected pull requests,labels,milestone"
;;
--wikis)
HEADER="repository name,author name,author login,datetime,page,action,revision id,added lines,deleted lines"
;;
--contributors)
HEADER="repository_name,login,name,email,url,permissions,total_commits,node_id,type,bio,site_admin"
;;
--workflow_runs)
HEADER="repository_name,display_title,event,head_branch,head_sha,name,path,started_at,total_duration,conclusion,status,url"
;;
*)
echo "Unknown ARG: '${{ matrix.args }}'"
exit 1
;;
esac

FIRST_LINE=$(head -n 1 out.csv)

if [[ "$FIRST_LINE" == "$HEADER"* ]]; then
echo "Header is valid for ${{ matrix.args }}"
else
echo "::error::Header is invalid for ${{ matrix.args }}"
echo "Expected: $HEADER"
echo "Actual: $FIRST_LINE"
exit 1
fi
Loading