Update Hugo dependencies #7
This file contains hidden or 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: Update Hugo Dependencies | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 3 * * *' # Run daily at 03:00 AM | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-hugo-modules: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Step 2: Setup Node.js | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| cache-dependency-path: '**/package-lock.json' | |
| # Step 3: Install dependencies | |
| - name: Install npm dependencies | |
| run: npm ci | |
| # Step 4: Update Hugo module dependencies | |
| - name: Update Hugo module dependencies | |
| id: update-modules | |
| run: | | |
| MOD_OUTPUT=$(npm run mod:update 2>&1) | |
| echo "$MOD_OUTPUT" | |
| MOD_UPDATES=$(echo "$MOD_OUTPUT" | grep '^go: upgraded' | sed 's/go: / - /' | sort -u) | |
| echo 'MOD_UPDATES<<EOF' >> $GITHUB_OUTPUT | |
| echo "$MOD_UPDATES" >> $GITHUB_OUTPUT | |
| echo 'EOF' >> $GITHUB_OUTPUT | |
| # Step 5: Create a Pull Request for changes | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: 'fix: update Hugo module dependencies' | |
| committer: GitHub <noreply@github.com> | |
| branch: hugo-mod-dependencies | |
| delete-branch: true | |
| title: 'Update Hugo module dependencies' | |
| body: | | |
| This PR is auto-generated by [create-pull-request][1]. | |
| **Changes to Hugo modules:** | |
| ${{ steps.update-modules.outputs.MOD_UPDATES }} | |
| [1]: https://github.com/peter-evans/create-pull-request | |
| labels: dependencies | |
| add-paths: | | |
| go.mod | |
| go.sum | |
| **/go.mod | |
| **/go.sum |