|
5 | 5 | - cron: "0 9 * * 1" # Weekly on Monday at 9am UTC |
6 | 6 | workflow_dispatch: |
7 | 7 |
|
8 | | -permissions: |
9 | | - contents: write |
10 | | - pull-requests: write |
11 | | - |
12 | 8 | 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 }} |
0 commit comments