Skip to content
Merged
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
44 changes: 44 additions & 0 deletions .github/workflows/opendata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ name: Generate Open Data

on:
workflow_dispatch:
schedule:
- cron: '24 16 * * 0'

jobs:
generate-opendata:
runs-on: ubuntu-latest
outputs:
snapshot: ${{ steps.find-snapshot.outputs.snapshot }}
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
Expand Down Expand Up @@ -114,3 +118,43 @@ jobs:
with:
name: opendata-csvs
path: data/*.zip

update-readme:
needs: generate-opendata
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Update README.md
run: |
sed -i "s/<!-- SNAPSHOT_DATE -->.*<!-- \/SNAPSHOT_DATE -->/<!-- SNAPSHOT_DATE -->${{ needs.generate-opendata.outputs.snapshot }}<!-- \/SNAPSHOT_DATE -->/g" README.md

- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git diff --quiet || git commit -am "chore: update latest snapshot date to ${{ needs.generate-opendata.outputs.snapshot }}"
git push

upload-dataset:
needs: generate-opendata
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: opendata-csvs
path: data

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: false

- name: Upload to Hugging Face
run: >-
uvx --from huggingface_hub hf upload Cofacts/line-msg-fact-check-tw ./data .
--repo-type dataset
--commit-message "${{ needs.generate-opendata.outputs.snapshot }} update"
--token ${{ secrets.HF_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
【Cofacts 真的假的】Open Datasets
=====

Latest dataset snapshot: <!-- SNAPSHOT_DATE -->2026-03-01<!-- /SNAPSHOT_DATE -->

[![CI test](https://github.com/cofacts/opendata/actions/workflows/ci.yml/badge.svg)](https://github.com/cofacts/opendata/actions/workflows/ci.yml)

We publish Cofacts data as Hugging Face dataset [`Cofacts/line-msg-fact-check-tw`](https://huggingface.co/datasets/Cofacts/line-msg-fact-check-tw). Application of Cofacts data has also been moved to Hugging Face.
Expand Down