Update Redirect Links #480
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: Update Redirect Links | |
permissions: | |
contents: write | |
on: | |
# Triggered by https://github.com/nodejs/node/blob/main/.github/workflows/update-release-links.yml | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update-redirect-links: | |
name: Update Redirect Links | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 | |
- name: Cache Dependencies | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: | | |
~/.npm | |
node_modules/.cache | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/format.yml') }} | |
restore-keys: ${{ runner.os }}-npm- | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install && npm update nodejs-latest-linker --save | |
- name: Update Redirect Links | |
run: node scripts/update-latest-versions.js && npm run format | |
env: | |
CF_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }} | |
CF_SECRET_ACCESS_KEY: ${{ secrets.CF_SECRET_ACCESS_KEY }} | |
- name: Commit Changes | |
id: git_auto_commit | |
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 | |
with: | |
commit_options: '--no-verify --no-signoff' | |
commit_message: 'chore: update redirect links' | |
branch: update-redirect-links | |
create_branch: true | |
- name: Open and Merge Pull Request | |
if: steps.git_auto_commit.outputs.changes_detected == 'true' | |
run: | | |
gh pr create --fill | |
gh pr merge --squash --delete-branch --admin | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} | |
- name: Deploy to Production | |
if: steps.git_auto_commit.outputs.changes_detected == 'true' | |
run: | | |
gh workflow run deploy.yml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} | |