chore(detekt): suppress startup complexity and generic-catch warnings #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upstream Sync | ||
| on: | ||
| schedule: | ||
| - cron: "0 9 * * 1" | ||
| workflow_dispatch: | ||
| jobs: | ||
| sync: | ||
| name: Check upstream submodule | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| fetch-depth: 0 | ||
| - name: Check for upstream updates | ||
| id: check | ||
| run: | | ||
| cd zeroclaw | ||
| git fetch origin main | ||
| LOCAL=$(git rev-parse HEAD) | ||
| REMOTE=$(git rev-parse origin/main) | ||
| echo "local=$LOCAL" >> "$GITHUB_OUTPUT" | ||
| echo "remote=$REMOTE" >> "$GITHUB_OUTPUT" | ||
| if [ "$LOCAL" = "$REMOTE" ]; then | ||
| echo "up_to_date=true" >> "$GITHUB_OUTPUT" | ||
| echo "Submodule is up to date" | ||
| else | ||
| echo "up_to_date=false" >> "$GITHUB_OUTPUT" | ||
| SHORT=$(echo "$REMOTE" | cut -c1-7) | ||
| echo "short_hash=$SHORT" >> "$GITHUB_OUTPUT" | ||
| COMMITS=$(git log --oneline "$LOCAL".."$REMOTE") | ||
| echo "New commits:" | ||
| echo "$COMMITS" | ||
| { | ||
| echo "commits<<EOF" | ||
| echo "$COMMITS" | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Create sync branch and PR | ||
| if: steps.check.outputs.up_to_date == 'false' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| BRANCH="chore/upstream-sync-${{ steps.check.outputs.short_hash }}" | ||
| if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then | ||
| echo "Branch $BRANCH already exists, skipping" | ||
| exit 0 | ||
| fi | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b "$BRANCH" | ||
| cd zeroclaw | ||
| git checkout origin/main | ||
| cd .. | ||
| git add zeroclaw | ||
| git commit -m "chore(upstream): update zeroclaw submodule to ${{ steps.check.outputs.short_hash }}" | ||
| git push origin "$BRANCH" | ||
| BODY="## Upstream ZeroClaw Update | ||
| Updated zeroclaw submodule to \`${{ steps.check.outputs.short_hash }}\`. | ||
| ### New upstream commits | ||
| \`\`\` | ||
| ${{ steps.check.outputs.commits }} | ||
| \`\`\` | ||
| > Auto-generated by the upstream-sync workflow." | ||
| gh pr create \ | ||
| --title "chore(upstream): update zeroclaw to ${{ steps.check.outputs.short_hash }}" \ | ||
| --body "$BODY" \ | ||
| --label "dependencies,upstream-sync" \ | ||
| --base main \ | ||
| --head "$BRANCH" | ||