Update Deps #49
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
# Workflow for updating Javascript dependencies with npm. | |
# Major version updates are handled separately, by Dependabot. | |
--- | |
name: Update Deps | |
on: | |
workflow_dispatch: | |
# Run every Monday at 1435 UTC | |
schedule: | |
- cron: '35 14 * * 1' | |
jobs: | |
workflow-auto-updates: | |
name: Update dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Update Docusaurus Javascript dependencies | |
working-directory: ./site | |
run: npm update --save | |
- name: Commit changes | |
id: commit | |
continue-on-error: true | |
run: | | |
git config user.name 'phylum-bot' | |
git config user.email '69485888+phylum-bot@users.noreply.github.com' | |
git commit -a -m "build: bump static site Javascript dependencies" | |
git push --force origin HEAD:workflow-auto-updates | |
- name: Create Pull Request | |
if: ${{ steps.commit.outcome == 'success' }} | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
github-token: ${{ secrets.GH_RELEASE_PAT }} | |
script: | | |
const response = await github.rest.pulls.create({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
head: "workflow-auto-updates", | |
base: context.ref, | |
title: "build: bump static site Javascript dependencies", | |
body: "Bump dependencies in `site/package-lock.json` for all SemVer-compatible updates.", | |
}); | |
console.log(response); |