codeforinzai / open-data-inzai

Inzai City Open Data
Creative Commons Attribution 4.0 International
1 stars 1 forks source link

オープンデータリストの更新をチェックするGitHub Actionsワークフローを追加 / Add GitHub Actions Workflow for Checking Updates in Open Data List #11

Closed ota2000 closed 1 month ago

ota2000 commented 2 months ago

印西市が提供するオープンデータリストの更新をチェックする新しいGitHub Actionsワークフローを追加します。このワークフローは毎月1日にスケジュールされており、手動でもトリガーできます。

関連Issue

ワークフローの詳細:

ジョブ: check-updates

ステップ:

  1. リポジトリをチェックアウト

    • actions/checkout@v4 を使用
  2. オリジナルファイルの存在を確認

    • リポジトリ内にオリジナルのオープンデータリストファイル (./original/122319_open_data_list.csv) が存在するか確認
    • ファイルが存在する場合は original_exists=true を出力し、存在しない場合は original_exists=false を出力
  3. 最新のオープンデータCSVファイルをダウンロード

    • 指定されたURLから最新のオープンデータリストファイルをダウンロード
    • ダウンロードに失敗した場合は download_failed=true を出力
  4. CSVファイルを比較

    • ダウンロードしたCSVファイルとオリジナルのCSVファイルを比較
    • 差分がある場合は diff_exists=true を出力し、差分がない場合は diff_exists=false を出力
  5. 更新が見つかった場合はIssueを作成

    • オープンデータリストに差分が見つかった場合にGitHub Issueを作成
    • Issueタイトル: "オープンデータリストに更新があります"
    • Issue本文: "オープンデータリストファイルに変更があります。内容を確認の上、速やかにデータの更新を行ってください。"
  6. オリジナルファイルが存在しない場合はIssueを作成

    • オリジナルのオープンデータリストファイルが存在しない場合にGitHub Issueを作成
    • Issueタイトル: "オリジナルのオープンデータリストファイルが存在しません"
    • Issue本文: "リポジトリにオリジナルのオープンデータリストファイル(/original/122319_open_data_list.csv)が見つかりませんでした。今後の比較のためにファイルを追加してください。"
  7. ダウンロードに失敗した場合はIssueを作成

    • 最新のオープンデータリストファイルのダウンロードに失敗した場合にGitHub Issueを作成
    • Issueタイトル: "最新のオープンデータリストのダウンロードに失敗しました"
    • Issue本文: "最新のオープンデータリストのダウンロードに失敗しました。URLをご確認の上再度お試しください。"

This pull request adds a new GitHub Actions workflow that checks for updates in the Open Data List provided by Inzai City. The workflow is scheduled to run on the first day of every month and can also be manually triggered.

Workflow Details:

Job: check-updates

Steps:

  1. Checkout repository

    • Uses actions/checkout@v4
  2. Check if original file exists

    • Checks if the original Open Data List file (./original/122319_open_data_list.csv) exists in the repository.
    • Outputs original_exists=true if the file exists, otherwise outputs original_exists=false.
  3. Download latest Open Data CSV file

    • Downloads the latest Open Data List file from the specified URL.
    • Outputs download_failed=true if the download fails.
  4. Compare CSV files

    • Compares the downloaded CSV file with the original CSV file.
    • Outputs diff_exists=true if there are differences, otherwise outputs diff_exists=false.
  5. Create Issue if updates are found

    • Creates a GitHub issue if differences are found in the Open Data List.
    • Issue Title: "オープンデータリストに更新があります"
    • Issue Body: "オープンデータリストファイルに変更があります。内容を確認の上、速やかにデータの更新を行ってください。"
  6. Create Issue if original file does not exist

    • Creates a GitHub issue if the original Open Data List file does not exist.
    • Issue Title: "オリジナルのオープンデータリストファイルが存在しません"
    • Issue Body: "リポジトリにオリジナルのオープンデータリストファイル(/original/122319_open_data_list.csv)が見つかりませんでした。今後の比較のためにファイルを追加してください。"
  7. Create Issue if download failed

    • Creates a GitHub issue if the download of the latest Open Data List file fails.
    • Issue Title: "最新のオープンデータリストのダウンロードに失敗しました"
    • Issue Body: "最新のオープンデータリストのダウンロードに失敗しました。URLをご確認の上再度お試しください。"
ota2000 commented 2 months ago

@jollyjoester わたしのほうでmergeまで出来る設定になっていますが、念の為お手隙の際にレビューお願いします。

ota2000 commented 1 month ago

61fba84

122319_open_data_list.csvに更新があったため追加