vscode: update to 1.128.0 #172
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: PR Title Check | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| paths: | |
| - 'vup/srcpkgs/**/*' | |
| permissions: {} | |
| jobs: | |
| check-title: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check PR Title | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| const title = context.payload.pull_request.title; | |
| const prNumber = context.payload.pull_request.number; | |
| // Allowed formats: | |
| // feat: add <pkgname> [<version>] | |
| // <pkgname>: update to <version> | |
| // fix: <description> | |
| // chore: <description> | |
| // docs: <description> | |
| // ci: <description> | |
| const patterns = [ | |
| /^(feat|add):\s+add\s+\S+/i, // New package | |
| /^\S+:\s+update\s+to\s+\S+/i, // Update package | |
| /^(fix|chore|docs|ci|refactor|test):\s+/i, // Standard conventional commits | |
| ]; | |
| const valid = patterns.some(p => p.test(title)); | |
| const reportDir = 'pr-check-report'; | |
| fs.mkdirSync(reportDir, { recursive: true }); | |
| fs.writeFileSync(`${reportDir}/pr_number.txt`, `${prNumber}\n`); | |
| fs.writeFileSync(`${reportDir}/status.txt`, valid ? 'success\n' : 'failure\n'); | |
| fs.writeFileSync(`${reportDir}/details.txt`, `${title}\n`); | |
| if (!valid) { | |
| const msg = [ | |
| `:warning: PR title does not follow conventions.`, | |
| '', | |
| '**New package:** `feat: add <pkgname>` or `feat: add <pkgname> <version>`', | |
| '**Update:** `<pkgname>: update to <version>`', | |
| '**Other:** `fix:`, `chore:`, `docs:`, `ci:`, `refactor:`, `test:`', | |
| '', | |
| `Current title: \`${title}\``, | |
| ].join('\n'); | |
| await core.summary | |
| .addRaw(msg) | |
| .write(); | |
| core.setFailed('PR title does not follow conventions. See job summary for format.'); | |
| } else { | |
| console.log(`PR title "${title}" is valid.`); | |
| } | |
| - name: Upload PR Check Report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pr-check-report | |
| path: pr-check-report/* | |
| if-no-files-found: ignore |