prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey

refactor update script

Tyler ac3d2783 0783527c

+76 -28
+69
.github/actions/taze-update/action.yml
···
··· 1 + description: Automatically update dependencies using taze and create a pull request 2 + 3 + name: Taze Update 4 + 5 + inputs: 6 + taze-input: 7 + description: Flags or args to pass to taze (default: -w) 8 + required: false 9 + default: -w 10 + branch-prefix: 11 + description: Prefix for the branch name (default: chore/update-deps) 12 + required: false 13 + default: chore/update-deps 14 + pr-title: 15 + description: Title for the pull request 16 + required: false 17 + default: 'chore: update dependencies' 18 + pr-labels: 19 + description: Comma-separated labels to add to the PR 20 + required: false 21 + default: dependencies 22 + github-token: 23 + description: GitHub token for creating PRs 24 + required: true 25 + 26 + runs: 27 + steps: 28 + - name: Install taze 29 + run: pnpm add -g taze 30 + shell: bash 31 + 32 + - name: Update dependencies 33 + run: taze ${{ inputs.taze-input }} 34 + shell: bash 35 + 36 + - name: Create Pull Request 37 + env: 38 + GH_TOKEN: ${{ inputs.github-token }} 39 + run: | 40 + BRANCH_NAME="${{ inputs.branch-prefix }}-$(date +%m-%d)" 41 + git config user.name "github-actions[bot]" 42 + git config user.email "github-actions[bot]@users.noreply.github.com" 43 + git checkout -b "$BRANCH_NAME" 44 + git add . 45 + if git diff --staged --quiet; then 46 + echo "No dependency updates available" 47 + exit 0 48 + fi 49 + git commit -m "${{ inputs.pr-title }}" 50 + git push origin "$BRANCH_NAME" 51 + 52 + PR_LABELS="${{ inputs.pr-labels }}" 53 + LABEL_ARGS="" 54 + if [ -n "$PR_LABELS" ]; then 55 + IFS=',' read -ra LABELS <<< "$PR_LABELS" 56 + for label in "${LABELS[@]}"; do 57 + LABEL_ARGS="$LABEL_ARGS --label $(echo $label | xargs)" 58 + done 59 + fi 60 + 61 + gh pr create --title "${{ inputs.pr-title }}" --body "## Automated dependency updates 62 + 63 + This PR was automatically generated using taze. 64 + 65 + Updates were performed using \`taze ${{ inputs.taze-input }}\`. 66 + 67 + Please review the changes carefully before merging." $LABEL_ARGS 68 + shell: bash 69 + using: composite
+7 -28
.github/workflows/update-dependencies.yml
··· 18 19 - uses: ./.github/actions/prepare 20 21 - - name: Install taze 22 - run: pnpm add -g taze 23 - 24 - - name: Update dependencies 25 - run: taze -w -r 26 - 27 - - name: Create Pull Request 28 - env: 29 - GH_TOKEN: ${{ github.token }} 30 - run: | 31 - BRANCH_NAME="chore/update-deps-$(date +%m-%d)" 32 - git config user.name "github-actions[bot]" 33 - git config user.email "github-actions[bot]@users.noreply.github.com" 34 - git checkout -b "$BRANCH_NAME" 35 - git add . 36 - if git diff --staged --quiet; then 37 - echo "No dependency updates available" 38 - exit 0 39 - fi 40 - git commit -m "chore: update dependencies" 41 - git push origin "$BRANCH_NAME" 42 - gh pr create --title "chore: update dependencies" --body "## Automated dependency updates 43 - 44 - This PR was automatically generated by the weekly dependency update workflow. 45 - 46 - Updates were performed using \`taze -w -r\` which updates all dependencies to their latest versions. 47 - 48 - Please review the changes carefully before merging." --label dependencies
··· 18 19 - uses: ./.github/actions/prepare 20 21 + - uses: ./.github/actions/taze-update 22 + with: 23 + taze-flags: -rw 24 + branch-prefix: update-deps 25 + pr-title: "update dependencies" 26 + pr-labels: dependencies 27 + github-token: ${{ github.token }}