Skip to content

ci: bump chronos to v0.0.8 #831

ci: bump chronos to v0.0.8

ci: bump chronos to v0.0.8 #831

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Guidelines Compliance
on:
pull_request:
types: [ opened, edited, synchronize, reopened ]
permissions:
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install commitlint
run: |
npm install --save-dev @commitlint/cli @commitlint/config-conventional
- name: Create commitlint config
run: |
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
- name: Validate PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo $PR_TITLE | npx commitlint
- name: Comment on PR if validation fails
if: failure()
uses: actions/github-script@v8
with:
script: |
const comment = `❌ **PR Title Validation Failed**
Please refer to [CONTRIBUTING.md](https://github.com/ozontech/seq-db/blob/main/.github/CONTRIBUTING.md)`;
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
validate-branch-name:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Validate branch name
id: validate-branch
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
run: |
# Pattern: {issue-number}-{branch-name}
# Issue number must be 0 or positive integer
BRANCH_PATTERN="^(0|[1-9][0-9]*)-[a-z0-9]+(-[a-z0-9]+)*$"
if [[ ! "$BRANCH_NAME" =~ $BRANCH_PATTERN ]]; then
echo "validation_failed=true" >> $GITHUB_OUTPUT
exit 1
fi
- name: Comment on PR if validation fails
if: failure()
uses: actions/github-script@v8
with:
script: |
const comment = `❌ **Branch Name Validation Failed**
Please refer to [CONTRIBUTING.md](https://github.com/ozontech/seq-db/blob/main/.github/CONTRIBUTING.md)`;
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});