mirror of
https://github.com/renovatebot/pre-commit-hooks.git
synced 2026-04-02 04:46:55 +00:00
70 lines
1.8 KiB
YAML
70 lines
1.8 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6 # tag=v3.1.2
|
|
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}"
|
|
|
|
release:
|
|
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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
|
|
|
|
- name: Get Renovate version
|
|
id: get-renovate-version
|
|
uses: mikefarah/yq@70403375d7b96075bd68b40c434807cff1593568 # tag=v4.25.2
|
|
with:
|
|
cmd: >-
|
|
yq eval
|
|
'.[]|select(.id=="renovate-config-validator")|.additional_dependencies[0]|split("@").[1]'
|
|
.pre-commit-hooks.yaml
|
|
|
|
- name: Create release
|
|
run: |
|
|
if ! gh release view "${TAG}" >/dev/null; then
|
|
gh release create "${TAG}" \
|
|
--notes "See https://github.com/renovatebot/renovate/releases/tag/${TAG} for more changes" \
|
|
--target "${TARGET}" \
|
|
--title "${TAG}"
|
|
else
|
|
echo 'release already exists'
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG: ${{ steps.get-renovate-version.outputs.result }}
|
|
TARGET: ${{ github.sha }}
|