-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #799 from rdmorganiser/dev-2.0.2
RDMO 2.0.2
- Loading branch information
Showing
10 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This CI job is adapted from: | ||
# Cookiecutter Django (2013-10-17), BSD-3-Clause license | ||
# Ref: https://github.com/cookiecutter/cookiecutter-django/blob/2023.10.17/.github/workflows/pre-commit-autoupdate.yml | ||
|
||
name: Update pre-commit hooks | ||
|
||
on: | ||
schedule: | ||
# run once a month at midnight of the first day of the month | ||
- cron: 0 0 1 * * | ||
# run manually from actions tab | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
auto-update: | ||
# Disables this workflow from running in a repository that is not part of the indicated organization/user | ||
if: github.repository_owner == 'rdmorganiser' | ||
permissions: | ||
contents: write # for peter-evans/create-pull-request to create branch | ||
pull-requests: write # for peter-evans/create-pull-request to create a PR | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
- run: python -m pip install pre-commit | ||
- run: pre-commit autoupdate > autoupdate.log | ||
- name: Prepare message for pr body | ||
run: | | ||
grep "updating" autoupdate.log > updates.log | ||
sed -i -e 's/\[/- </g' updates.log | ||
sed -i -e 's/\]/>/g' updates.log | ||
echo -e "## Proposed changes\n\nBumps the pre-commit config with the following updates:\n" > pr-body.md | ||
cat updates.log >> pr-body.md | ||
echo -e "\n---\nThis PR is auto-generated once a month." >> pr-body.md | ||
# Ref: https://github.com/peter-evans/create-pull-request | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | ||
with: | ||
branch: pre-commit-autoupdate | ||
base: dependency-updates | ||
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
title: "build: update pre-commit hooks" | ||
commit-message: "build: update pre-commit hooks" | ||
add-paths: .pre-commit-config.yaml | ||
body-path: pr-body.md | ||
labels: | | ||
dependencies | ||
pre-commit | ||
type: maintenance | ||
delete-branch: true | ||
- name: Write to job summary | ||
run: | | ||
cat updates.log >> $GITHUB_STEP_SUMMARY |
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
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
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
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
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
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
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
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
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