Pre-commit autoupdate #519
This file contains 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: Pre-commit autoupdate | |
on: # yamllint disable-line rule:truthy | |
schedule: | |
# Run daily at 5am | |
- cron: '0 5 * * *' | |
jobs: | |
auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit autoupdate | |
run: pre-commit autoupdate | |
- name: Generate app token | |
id: app-token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Create pull request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
branch: pre-commit-autoupdate | |
delete-branch: true | |
title: Auto-update pre-commit hooks | |
commit-message: Auto-update pre-commit hooks | |
body: | | |
Update versions of tools in pre-commit config to latest version. | |
Auto-generated by [create-pull-request][1]. | |
[1]: https://github.com/peter-evans/create-pull-request | |
# yamllint disable rule:line-length | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" >> $GITHUB_STEP_SUMMARY | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY | |
echo "Pull Request Operation Performed - ${{ steps.cpr.outputs.pull-request-operation }}" >> $GITHUB_STEP_SUMMARY |