Lock File Maintenance #644
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: "Lock File Maintenance" | |
on: # yamllint disable-line rule:truthy | |
schedule: | |
- cron: "0 */3 * * *" # At minute 0 past every 3rd hour. | |
pull_request: | |
branches: | |
- "dependabot/**" | |
workflow_dispatch: # yamllint disable-line rule:empty-values | |
permissions: | |
contents: "read" # for checkout | |
jobs: | |
lock-file: | |
name: "Lock File Maintenance" | |
if: "github.repository == 'anolilab/javascript-style-guide'" | |
runs-on: "ubuntu-latest" | |
permissions: | |
contents: "write" | |
steps: | |
- name: "Harden Runner" | |
uses: "step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6" # v2.8.1 | |
with: | |
egress-policy: "audit" | |
- name: "Git checkout" | |
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2 | |
with: | |
token: "${{ secrets.LOCK_MAINTENANCE_GITHUB_TOKEN }}" | |
env: | |
GIT_COMMITTER_NAME: "GitHub Actions Shell" | |
GIT_AUTHOR_NAME: "GitHub Actions Shell" | |
EMAIL: "github-actions[bot]@users.noreply.github.com" | |
- name: "Setup resources and environment" | |
id: "setup" | |
uses: "anolilab/workflows/step/setup@main" | |
with: | |
node-version: "18.x" | |
cache-prefix: "lock-file" | |
install-packages: "false" | |
- name: "Update lock file" | |
if: "success()" | |
run: "pnpm install --lockfile-only" | |
- name: "Commit lock file" | |
if: "success()" | |
uses: "stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842" # v5.0.1 | |
with: | |
file_pattern: "pnpm-lock.yaml" | |
commit_message: "chore: updated lock file [ci skip]" | |
commit_user_name: "github-actions-shell" | |
commit_user_email: "github-actions[bot]@users.noreply.github.com" | |
commit_author: "github-actions-shell <github-actions[bot]@users.noreply.github.com>" |