renovatebot-pre-commit-hooks/.github/workflows/build.yaml
renovate[bot] f7a11bfa73
chore(deps): update mikefarah/yq action to v4.24.5 (#171)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-14 23:19:28 +00:00

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@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # tag=v3.0.1
- 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}"
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@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # tag=v3.0.1
with:
fetch-depth: 0 # all tags
- name: Get Renovate version
id: get-renovate-version
uses: mikefarah/yq@ed5b811f37384d92f62898492ddd81b6dc3af38f # tag=v4.24.5
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