Skip to content

Commit c172644

Browse files
committed
chore: use reusable tessl update workflow
Replace inline workflow with thin caller to codeflash-ai/github-workflows tessl-update.yml. Move missing tiles list to .tessl/missing-tiles.txt.
1 parent c35e026 commit c172644

2 files changed

Lines changed: 28 additions & 89 deletions

File tree

.github/workflows/tessl-update.yml

Lines changed: 4 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -5,93 +5,8 @@ on:
55
- cron: "0 9 * * 1" # Weekly on Monday at 9am UTC
66
workflow_dispatch:
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
128
jobs:
13-
update-tiles:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- uses: tesslio/setup-tessl@v2
19-
with:
20-
token: ${{ secrets.TESSL_TOKEN }}
21-
22-
- name: Update existing tiles
23-
run: tessl update --yes
24-
25-
- name: Attempt to install missing tiles
26-
run: |
27-
workflow_file=".github/workflows/tessl-update.yml"
28-
missing_tiles=(
29-
tessl/pypi-tree-sitter-javascript
30-
tessl/pypi-tree-sitter-typescript
31-
tessl/pypi-tree-sitter-java
32-
tessl/pypi-tree-sitter-groovy
33-
tessl/pypi-tree-sitter-kotlin
34-
tessl/pypi-pytest-timeout
35-
tessl/pypi-junitparser
36-
tessl/pypi-isort
37-
tessl/pypi-line-profiler
38-
tessl/pypi-pytest-asyncio
39-
tessl/pypi-pytest-memray
40-
tessl/pypi-unidiff
41-
tessl/pypi-ruff
42-
tessl/npm-msgpack--msgpack
43-
tessl/npm-babel--register
44-
tessl/npm-babel--preset-env
45-
tessl/maven-com-esotericsoftware--kryo
46-
tessl/maven-org-objenesis--objenesis
47-
tessl/maven-org-xerial--sqlite-jdbc
48-
tessl/maven-org-ow2-asm--asm
49-
tessl/maven-org-ow2-asm--asm-commons
50-
)
51-
installed=()
52-
for tile in "${missing_tiles[@]}"; do
53-
if tessl install --yes "$tile" 2>&1; then
54-
installed+=("$tile")
55-
fi
56-
done
57-
for tile in "${installed[@]}"; do
58-
escaped=$(printf '%s\n' "$tile" | sed 's/[/]/\\\//g')
59-
sed -i "/^ ${escaped}$/d" "$workflow_file"
60-
done
61-
if [ ${#installed[@]} -eq ${#missing_tiles[@]} ]; then
62-
sed -i '/^ - name: Attempt to install missing tiles$/,/^ - name:/{ /^ - name: Attempt to install missing tiles$/,/^ - name: Check/{ /^ - name: Check/!d; }; }' "$workflow_file" || true
63-
fi
64-
65-
- name: Check for changes
66-
id: changes
67-
run: |
68-
if git diff --quiet && git diff --cached --quiet; then
69-
echo "changed=false" >> "$GITHUB_OUTPUT"
70-
else
71-
echo "changed=true" >> "$GITHUB_OUTPUT"
72-
fi
73-
74-
- name: Create PR with updates
75-
if: steps.changes.outputs.changed == 'true'
76-
env:
77-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
run: |
79-
branch="chore/tessl-tile-updates-$(date +%Y%m%d)"
80-
git config user.name "github-actions[bot]"
81-
git config user.email "github-actions[bot]@users.noreply.github.com"
82-
git checkout -b "$branch"
83-
git add tessl.json .tessl/tiles/ .github/workflows/tessl-update.yml
84-
git commit -m "chore: update tessl tiles $(date +%Y-%m-%d)"
85-
git push origin "$branch"
86-
gh pr create \
87-
--title "chore: update tessl tiles $(date +%Y-%m-%d)" \
88-
--body "$(cat <<'EOF'
89-
## Summary
90-
91-
Automated weekly tessl tile update:
92-
- Updated existing tiles to latest versions
93-
- Installed newly available tiles for project dependencies
94-
95-
Generated by the **tessl-update** workflow.
96-
EOF
97-
)"
9+
tessl:
10+
uses: codeflash-ai/github-workflows/.github/workflows/tessl-update.yml@main
11+
secrets:
12+
TESSL_TOKEN: ${{ secrets.TESSL_TOKEN }}

.tessl/missing-tiles.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PyPI
2+
tessl/pypi-tree-sitter-javascript
3+
tessl/pypi-tree-sitter-typescript
4+
tessl/pypi-tree-sitter-java
5+
tessl/pypi-tree-sitter-groovy
6+
tessl/pypi-tree-sitter-kotlin
7+
tessl/pypi-pytest-timeout
8+
tessl/pypi-junitparser
9+
tessl/pypi-isort
10+
tessl/pypi-line-profiler
11+
tessl/pypi-pytest-asyncio
12+
tessl/pypi-pytest-memray
13+
tessl/pypi-unidiff
14+
tessl/pypi-ruff
15+
# npm
16+
tessl/npm-msgpack--msgpack
17+
tessl/npm-babel--register
18+
tessl/npm-babel--preset-env
19+
# Maven
20+
tessl/maven-com-esotericsoftware--kryo
21+
tessl/maven-org-objenesis--objenesis
22+
tessl/maven-org-xerial--sqlite-jdbc
23+
tessl/maven-org-ow2-asm--asm
24+
tessl/maven-org-ow2-asm--asm-commons

0 commit comments

Comments
 (0)