chore(deps): bump the actions group with 2 updates #240
Workflow file for this run
This file contains hidden or 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: Changeset Check | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| branches: [main] | |
| jobs: | |
| check: | |
| name: Changeset present | |
| runs-on: ubuntu-latest | |
| # Skip the "Version Packages" PR that changesets/action creates | |
| if: | | |
| github.actor != 'github-actions[bot]' && | |
| !startsWith(github.head_ref, 'changeset-release/') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for changeset or skip-changelog label | |
| run: | | |
| if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | grep -q '"skip-changelog"'; then | |
| echo "skip-changelog label present — no changeset required." | |
| exit 0 | |
| fi | |
| if git diff --name-only origin/main...HEAD | grep -qE '^\.changeset/.+\.md$'; then | |
| echo "Changeset found." | |
| exit 0 | |
| fi | |
| echo "" | |
| echo "No changeset found." | |
| echo "" | |
| echo "Run 'npx changeset add', select patch/minor/major, write one line, and commit the result." | |
| echo "If this PR does not need a version bump (e.g. docs, CI, tests), add the 'skip-changelog' label." | |
| exit 1 | |
| - name: Validate changeset packages | |
| run: | | |
| # Collect workspace package names from root and packages/*/package.json | |
| WORKSPACE_PKGS=$(node -e " | |
| const fs = require('fs'); | |
| const root = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
| const pkgs = [root.name]; | |
| try { | |
| const dirs = fs.readdirSync('packages'); | |
| for (const d of dirs) { | |
| const p = 'packages/' + d + '/package.json'; | |
| if (fs.existsSync(p)) pkgs.push(JSON.parse(fs.readFileSync(p, 'utf8')).name); | |
| } | |
| } catch {} | |
| console.log(pkgs.join('\n')); | |
| ") | |
| ERRORS=0 | |
| for f in .changeset/*.md; do | |
| [ "$f" = ".changeset/*.md" ] && break | |
| [ "$(basename "$f")" = "README.md" ] && continue | |
| # Extract package names from changeset frontmatter | |
| PKGS=$(sed -n '/^---$/,/^---$/{ /^"/{s/"//g; s/:.*//; p}; /^[a-z@]/{s/:.*//; p} }' "$f") | |
| for pkg in $PKGS; do | |
| if ! echo "$WORKSPACE_PKGS" | grep -qxF "$pkg"; then | |
| echo "::error file=$f::Changeset references '$pkg' which is not a workspace package." | |
| echo " Workspace packages: $(echo "$WORKSPACE_PKGS" | tr '\n' ', ')" | |
| ERRORS=1 | |
| fi | |
| done | |
| done | |
| if [ "$ERRORS" = "1" ]; then | |
| echo "" | |
| echo "Fix: edit the changeset .md to only reference packages in this workspace." | |
| echo "The root package is '@resciencelab/agent-world-network'." | |
| exit 1 | |
| fi | |
| echo "All changeset packages are valid workspace members." |