Skip to content

repost node-api team meeting recording post #53

repost node-api team meeting recording post

repost node-api team meeting recording post #53

Workflow file for this run

name: Validate newly added JSON
on:
pull_request_target:
types:
- opened
- ready_for_review
- reopened
- synchronize
paths:
- records/new/*.json
permissions:
contents: read
jobs:
validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: refs/pull/${{ github.event.pull_request.number }}/merge
persist-credentials: false
# Must be done before setup-node.
- name: Enable Corepack
run: corepack enable
# We are using `pull_request_target`, meaning untrusted code could access the secrets.
# For PRs from forks, we want to rollback to the trusted version of `actions/`. Other
# directories do not contain any runnable code.
- if: github.event.pull_request.head.repo.full_name != github.repository
run: git checkout HEAD^ -- actions/
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: actions/yarn.lock
- name: Install Dependencies
run: yarn install --frozen-lockfile
working-directory: ./actions
- name: Find newly added JSON files
id: find-json
run: |
# Get the list of added JSON files in the records/new/ directory
ADDED_FILES=$(git diff HEAD^..HEAD --diff-filter=A --name-only records/new | grep '/.*\.json$' || true)
echo "NEW_JSON_FILES=$ADDED_FILES" >> "$GITHUB_ENV"
- name: Validate files
if: env.NEW_JSON_FILES
env:
BLUESKY_IDENTIFIER_NODEJS_ORG: nodejs.org
BLUESKY_APP_PASSWORD_NODEJS_ORG: ${{ secrets.BLUESKY_APP_PASSWORD_NODEJS_ORG }}
run: |
for file in $NEW_JSON_FILES; do
echo "Processing $file..."
node actions/login-and-validate.js "$file"
done