Skip to content

update-pre-commit-action

Actions
Run update-pre-commit to keep pre-commit hooks up to date and optionally create pull request
1.0.28
Latest
Star (0)

update-pre-commit-action

OpenSSF Best Practices CI marketplace coverage

This action runs update-pre-commit to keep your pre-commit hooks up to date and optionally creates pull request.


update-pre-commit:

  1. reduces your supply chain risks with openssf best practices in our development and operations.
  2. automates your change management operation to optionally create pull request on GitHub.
  3. protects you against unreliable revs such as alpha, beta, prerelease, and rc.

😎 GitHub Action workflow examples

Use the example workflows below to create your own workflow inside .github/workflows/.


Example 1️⃣ - summary

update-pre-commit-action:

  • runs on a scheduled interval - every day at 5:30 pm UTC (- cron: '30 17 * * *')
  • uses GitHub Token with permissions: contents: write and pull-requests: write
  • updates .pre-commit-config.yaml when new revs become available (dry-run: false)
  • opens a pull request after update to .pre-commit-config.yaml (open-pr: true)

Example 1️⃣ - workflow

name: update-pre-commit-action

on:
  # on schedule: e.g. every day at 5:30 pm UTC
  schedule:
    - cron: '30 17 * * *'

  # on demand
  workflow_dispatch:

permissions:
  contents: read
  pull-requests: read

jobs:
  update-pre-commit:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write

    steps:
    - name: Run update-pre-commit
      id: update-pre-commit
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      uses: tagdots/update-pre-commit-action@a80688d12cf761973e340674bcf552af366afba5 # 1.0.28
      with:
        file: .pre-commit-config.yaml
        dry-run: false
        open-pr: true

Example 2️⃣ - summary

update-pre-commit-action:

  • runs on a scheduled interval - every day at 5:30 pm UTC (- cron: '30 17 * * *')
  • uses GitHub Token with permissions: contents: read and pull-requests: read
  • updates .pre-commit-config.yaml when new revs become available (dry-run: false)
  • Does Not open a pull request (open-pr: false)

Example 2️⃣ - workflow

name: update-pre-commit-action

on:
  # on schedule: e.g. every day at 5:30 pm UTC
  schedule:
    - cron: '30 17 * * *'

  # on demand
  workflow_dispatch:

permissions:
  contents: read
  pull-requests: read

jobs:
  update-pre-commit:
    runs-on: ubuntu-latest

    steps:
    - name: Run update-pre-commit
      id: update-pre-commit
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      uses: tagdots/update-pre-commit-action@a80688d12cf761973e340674bcf552af366afba5 # 1.0.28
      with:
        file: .pre-commit-config.yaml
        dry-run: false
        open-pr: false

😕 Troubleshooting

We are here to help - open an issue


📖 License

MIT License.

update-pre-commit-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run update-pre-commit to keep pre-commit hooks up to date and optionally create pull request
1.0.28
Latest

update-pre-commit-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.