Skip to content

Commit f51b2e3

Browse files
Wauplinpaulinebm
andauthored
Run tasks-gen scripts automatically (#964)
This PR adds a Github Action to automatically run the `@huggingface/tasks-gen` scripts and open a PR if anything has changed. The workflow is triggered once a day (3am) and can be triggered manually if needed. Here is an example of auto-generated PR: #1030. --- Note: lint issues seems unrelated. But it doesn't seem to happen on main (see [here](https://github.com/huggingface/huggingface.js/actions/workflows/lint.yml?query=branch%3Amain)) so I don't know what's causing it 😕 --------- Co-authored-by: Pauline Bailly-Masson <[email protected]>
1 parent b863909 commit f51b2e3

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/update-specs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Tasks - Update specs
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 3 * * *" # Every day at 3am
7+
8+
concurrency:
9+
group: update-specs
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
working-directory: packages/tasks-gen
15+
16+
jobs:
17+
pull_request:
18+
runs-on: ubuntu-latest
19+
steps:
20+
# Setup
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version: "20"
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
run_install: true
29+
30+
# Generate specs
31+
- run: pnpm run inference-tgi-import
32+
- run: pnpm run inference-tei-import
33+
- run: pnpm run inference-codegen
34+
35+
# Check changes
36+
- run: git status
37+
38+
# Create or update Pull Request
39+
- name: Create Pull Request
40+
uses: peter-evans/create-pull-request@v7
41+
with:
42+
token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }}
43+
commit-message: Update tasks specs (automated commit)
44+
branch: update-tasks-specs-automated-pr
45+
delete-branch: true
46+
title: "[Bot] Update tasks specs"
47+
body: |
48+
This PR updates the @huggingface/tasks specs. It has been generated by running:
49+
```sh
50+
pnpm run inference-tgi-import
51+
pnpm run inference-tei-import
52+
pnpm run inference-codegen
53+
```
54+
55+
This PR was automatically created by the [Tasks - Update specs workflow](https://github.com/huggingface/huggingface.js/blob/main/.github/update-specs.yml).
56+
57+
Make sure the changes are correct before merging.
58+
labels: |
59+
tasks
60+
specs
61+
reviewers: |
62+
Wauplin
63+
hanouticelina

0 commit comments

Comments
 (0)