Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/codemod_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,10 @@ jobs:

✅ Codemod has been successfully published to the registry!
EOF

refresh-learn:
name: Sync nodejs/learn
needs: validate-and-publish
uses: ./.github/workflows/refresh-learn.yml
secrets:
LEARN_REPO_TOKEN: ${{ secrets.LEARN_REPO_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/refresh-learn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Refresh nodejs/learn

on:
workflow_call:
secrets:
LEARN_REPO_TOKEN:
required: true
description: >
Fine-grained PAT scoped to nodejs/learn with
Contents: write and Pull requests: write permissions.

permissions:
contents: read

jobs:
sync:
name: Sync READMEs to nodejs/learn
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Harden Runner
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit

# Check out nodejs/learn
- name: Checkout nodejs/learn
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: nodejs/learn
token: ${{ secrets.LEARN_REPO_TOKEN }}
persist-credentials: false

# Check out this repo
- name: Checkout userland-migrations
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: source
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: source/.nvmrc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's source/?


- name: Sync READMEs and update site.json
run: node source/scripts/sync-learn.mjs

- name: Open or update pull request on nodejs/learn
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
env:
GITHUB_TOKEN: ${{ secrets.LEARN_REPO_TOKEN }}
with:
title: "chore: sync userland-migrations codemods"
body: |
Automated sync of codemod documentation from
[nodejs/userland-migrations](https://github.com/nodejs/userland-migrations).

Updates `pages/userland-migrations/` and `site.json` with the
latest README from every published recipe.

---
*This PR is opened/updated automatically on every codemod publish.*
branch: automated/sync-userland-migrations
commit-message: "chore: sync userland-migrations codemods"
Loading
Loading