Skip to content
Open
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
18 changes: 14 additions & 4 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,40 @@
exit 1
fi

validate-changelog:
name: Validate changelog
validate-changelogs:
name: Validate changelogs
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
node-version: [24.x]
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn workspace ${{ matrix.package-name }} changelog:validate
- name: Validate changelogs
env:
CHILD_WORKSPACE_PACKAGE_NAMES: ${{ needs.prepare.outputs.child-workspace-package-names }}
run: |
EXIT_CODE=0
for package_name in $(echo "$CHILD_WORKSPACE_PACKAGE_NAMES" | jq --raw-output '.[]'); do
echo "Validating changelog for $package_name"
if ! yarn workspace "$package_name" run changelog:validate; then
EXIT_CODE=1
fi
done
exit "$EXIT_CODE"
Comment on lines +78 to +85
Copy link
Copy Markdown
Contributor

@mcmire mcmire May 13, 2026

Choose a reason for hiding this comment

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

If I recall correctly, the reason why we split this script up was because if any one package had an changelog issue, it was really hard to find it based on the job output.

That said, I now see that if you pass --verbose to yarn workspaces foreach, it prints output for a workspace pessimistically. So it will only show errors and will hide everything else. In fact, this is already what yarn changelog:validate is doing.

Furthermore yarn workspaces foreach will exit with 1 if any of the subcommands fails. Which is what you seem to be doing here too 🤔

So... maybe we can add changelog:validate to the lint command and also to the lint step above? And then we can remove this validate-changelog job altogether.

- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

validate-changelog-diffs:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: Validate changelog diffs
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
runs-on: ubuntu-latest
Expand Down
Loading