Skip to content

Update Redirect Links #972

Update Redirect Links

Update Redirect Links #972

Workflow file for this run

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:
concurrency:
group: update-redirect-links
cancel-in-progress: false
jobs:
update-redirect-links:
name: Update Redirect Links
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
dist-prod.07be8d2fbc940503ca1be344714cb0d1.r2.cloudflarestorage.com:443
github.com:443
hooks.slack.com:443
registry.npmjs.org:443
release-assets.githubusercontent.com:443
- name: Git Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache Dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
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@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
cache: 'npm'
- name: Install dependencies
run: npm ci && npm update nodejs-latest-linker --save
- name: Update Redirect Links
run: node scripts/build-r2-symlinks.mjs && node --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@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.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 }}
- name: Alert on Failure
if: failure() && github.repository == 'nodejs/release-cloudflare-worker'
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
env:
SLACK_COLOR: '#DE512A'
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: Update links failed (${{ github.ref }})
SLACK_MESSAGE: The `update-links.yml` action has failed.
SLACK_USERNAME: nodejs-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}