mirror of
https://github.com/renovatebot/pre-commit-hooks.git
synced 2026-04-04 13:56:53 +00:00
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: build
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3.0.0
|
|
with:
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run pre-commit
|
|
run: >-
|
|
pre-commit try-repo --all-files
|
|
--ref="${GITHUB_SHA}"
|
|
"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
|
|
|
tag:
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
needs: [test]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
|
|
with:
|
|
fetch-depth: 0 # all tags
|
|
|
|
- name: Get Renovate version
|
|
id: get-renovate-version
|
|
uses: mikefarah/yq@03f57b7034d0330d54663881def67523347dfc9c # tag=v4.23.1
|
|
with:
|
|
cmd: >-
|
|
yq eval
|
|
'.[]|select(.id=="renovate-config-validator")|.additional_dependencies[0]|split("@").[1]'
|
|
.pre-commit-hooks.yaml
|
|
|
|
- name: Create tag
|
|
run: |
|
|
TAG=${{ steps.get-renovate-version.outputs.result }}
|
|
if ! git show-ref --tags "${TAG}" --quiet; then
|
|
git tag "${TAG}" && git push origin "${TAG}"
|
|
fi
|