chore(deps): update typescript to v6 #113
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: Pull Request Validation | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| # Cancel in-progress runs when new commits are pushed | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| jobs: | ||
| validate-commits: | ||
| name: Validate Conventional Commits | ||
| runs-on: arc-happyvertical | ||
| steps: | ||
| - name: Checkout PR branch | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Validate commit messages | ||
| uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6 | ||
| with: | ||
| configFile: commitlint.config.mjs | ||
| - name: Determine version bump | ||
| id: version | ||
| run: | | ||
| commits=$(git log origin/main..HEAD --no-merges --pretty=format:"%s") | ||
| bump="patch" | ||
| if echo "$commits" | grep -qE "^feat(\(.+\))?!?:"; then | ||
| bump="minor" | ||
| fi | ||
| if echo "$commits" | grep -qiE "(BREAKING CHANGE|!:)"; then | ||
| bump="minor" # Treat as minor until 1.0.0 | ||
| fi | ||
| echo "bump=$bump" >> $GITHUB_OUTPUT | ||
| echo "Will perform $bump version bump on merge" | ||
| - name: Comment on PR | ||
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | ||
| with: | ||
| script: | | ||
| const bump = '${{ steps.version.outputs.bump }}'; | ||
| const comment = `## Version Bump Preview | ||
| When this PR is merged, @happyvertical/ocr will receive a **${bump}** version bump based on your conventional commits. | ||
| ### What happens on merge? | ||
| 1. Tests run on main branch | ||
| 2. Package is built | ||
| 3. Version is bumped automatically | ||
| 4. Package is published to GitHub Packages | ||
| 5. Git tag is created | ||
| No manual intervention needed!`; | ||
| // Check if we already commented | ||
| const { data: comments } = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number | ||
| }); | ||
| const existingComment = comments.find(c => | ||
| c.user.login === 'github-actions[bot]' && | ||
| c.body.includes('Version Bump Preview') | ||
| ); | ||
| if (existingComment) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: existingComment.id, | ||
| body: comment | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: comment | ||
| }); | ||
| } | ||
| test: | ||
|
Check failure on line 97 in .github/workflows/on-pull-request.yml
|
||
| name: Validate Changes | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: | ||
| HAVE_RELEASE_APP_ID: ${{ secrets.HAVE_RELEASE_APP_ID }} | ||
| HAVE_RELEASE_APP_PRIVATE_KEY: ${{ secrets.HAVE_RELEASE_APP_PRIVATE_KEY }} | ||