Datasets:

ArXiv:
Felipe Parodi commited on
Commit
c5084cf
·
1 Parent(s): 5b52791

Add GH Action to sync to HuggingFace

Browse files
Files changed (1) hide show
  1. .github/workflows/sync-to-hf.yml +7 -22
.github/workflows/sync-to-hf.yml CHANGED
@@ -4,10 +4,10 @@ on:
4
  push:
5
  branches: [main]
6
  paths: [README.md]
7
- workflow_dispatch: # Allow manual trigger
8
 
9
  concurrency:
10
- group: "huggingface-sync"
11
  cancel-in-progress: true
12
 
13
  jobs:
@@ -15,13 +15,13 @@ jobs:
15
  runs-on: ubuntu-latest
16
  permissions:
17
  contents: read
18
- issues: write # For creating failure notification issues
19
 
20
  steps:
21
  - name: Checkout
22
  uses: actions/checkout@v4
23
  with:
24
- fetch-depth: 0 # Full history needed for git push
25
 
26
  - name: Push to HuggingFace
27
  run: |
@@ -32,25 +32,10 @@ jobs:
32
  uses: actions/github-script@v7
33
  with:
34
  script: |
35
- const date = new Date().toISOString().split('T')[0];
36
- const body = [
37
- 'The automatic sync to HuggingFace failed.',
38
- '',
39
- '**Commit:** ' + context.sha,
40
- '**Run:** ' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId,
41
- '',
42
- 'Please check the workflow logs and manually sync if needed:',
43
- '```bash',
44
- 'git push --force https://fparodi:YOUR_HF_TOKEN@huggingface.co/datasets/fparodi/awesome-computational-primatology main',
45
- '```',
46
- '',
47
- '---',
48
- '*This issue was automatically created by the HuggingFace sync workflow.*'
49
- ].join('\n');
50
  github.rest.issues.create({
51
  owner: context.repo.owner,
52
  repo: context.repo.repo,
53
- title: '🤗 HuggingFace Sync Failed - ' + date,
54
- body: body,
55
- labels: ['maintenance', 'huggingface']
56
  });
 
4
  push:
5
  branches: [main]
6
  paths: [README.md]
7
+ workflow_dispatch:
8
 
9
  concurrency:
10
+ group: huggingface-sync
11
  cancel-in-progress: true
12
 
13
  jobs:
 
15
  runs-on: ubuntu-latest
16
  permissions:
17
  contents: read
18
+ issues: write
19
 
20
  steps:
21
  - name: Checkout
22
  uses: actions/checkout@v4
23
  with:
24
+ fetch-depth: 0
25
 
26
  - name: Push to HuggingFace
27
  run: |
 
32
  uses: actions/github-script@v7
33
  with:
34
  script: |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  github.rest.issues.create({
36
  owner: context.repo.owner,
37
  repo: context.repo.repo,
38
+ title: 'HuggingFace Sync Failed - ' + new Date().toISOString().slice(0, 10),
39
+ body: 'The automatic sync to HuggingFace failed.\n\nSee: ' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId,
40
+ labels: ['maintenance']
41
  });