Skip to content
Merged
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
53 changes: 2 additions & 51 deletions .github/workflows/refresh-npm-status.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Refresh npm status

on:
schedule:
- cron: "23 * * * *"
workflow_dispatch:
push:
branches: [main]
Expand Down Expand Up @@ -31,56 +29,9 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: "24"
- run: node --test scripts/update-npm-status.test.mjs

refresh:
if: github.event_name != 'pull_request'
needs: check
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: "24"
- run: node scripts/update-npm-status.mjs
- name: Open or update the package status pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
if git diff --quiet -- profile/README.md; then
echo "No npm status changes to publish."
exit 0
fi

branch="automation/npm-status-refresh"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add profile/README.md
git commit -m "Refresh npm publication status and versions"

if git fetch origin "refs/heads/$branch:refs/remotes/origin/$branch"; then
lease="$(git rev-parse "refs/remotes/origin/$branch")"
git push --force-with-lease="refs/heads/$branch:$lease" origin "HEAD:refs/heads/$branch"
else
git push origin "HEAD:refs/heads/$branch"
fi

pr_number="$(gh pr list --repo "$GITHUB_REPOSITORY" --head "$branch" --base main --state open --json number --jq '.[0].number // empty')"
if [[ -n "$pr_number" ]]; then
echo "Updated npm status pull request #$pr_number."
else
gh pr create \
--repo "$GITHUB_REPOSITORY" \
--head "$branch" \
--base main \
--title "Refresh npm publication status and versions" \
--body "Automated refresh of the organization profile from the public npm registry."
fi
- run: node --test scripts/update-npm-status.test.mjs
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ registry's `latest` versions, and `node --test scripts/update-npm-status.test.mj
to check the updater.

[Refresh npm status](https://github.com/lapismd/.github/actions/workflows/refresh-npm-status.yml)
runs hourly, on updater changes, and on manual dispatch. It opens or updates one
automation pull request when package status changes. Registry errors fail the
refresh and preserve the previous profile; a registry 404 is the only response
treated as unpublished.
runs updater tests on changes and manual dispatch. The generator remains owned
here; the old scheduled GITHUB_TOKEN writer is retired to avoid competing PR
writers and workflow-approval waits.

[The central profile pilot](https://github.com/lapismd/dependency-automation/actions/workflows/profile-refresh.yml)
generates the candidate without App credentials, then validates and publishes
only npm-status cells through a separate worker using the existing App. It keeps
one rolling PR, stops for manual branch repairs, and preserves ordinary CI and
merge policy. The pilot is manual-only until hosted acceptance is recorded in
[the rollout tracker](https://github.com/lapismd/dependency-automation/blob/main/PLAN.md).
No secret is copied to this repository. Registry errors preserve the previous
profile; a registry 404 is the only response treated as unpublished.

This repository contains organization profile documentation only. It does not
configure CI, publishing, or policy for the other repositories.
Loading