Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code style checker for package.json file #1053

Merged
merged 5 commits into from
Jun 23, 2022
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
36 changes: 36 additions & 0 deletions .github/workflows/pull-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,42 @@ jobs:
with:
xml-file: ./appinfo/info.xml
xml-schema-file: ./info.xsd

package-lint:
name: Make sure the package.json is well-formatted
runs-on: ubuntu-latest

steps:
- name: Checkout of the app
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Get the date
id: date
run: echo "::set-output name=date::$(date +%Y-%m-%d)"
- name: Cache NPM cache
uses: actions/cache@v2.1.7
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ steps.date.outputs.date }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.date.outputs.date }}-
${{ runner.os }}-node-

- name: Install NPM modules
run: npm install

- name: Perform the test
run: |
npm run package-lint

if [ $(git diff --name-only package.json | wc -l) -gt 0 ]; then
echo '::error file=package.json::The package.json file is not validly formatted.'
echo '::notice::It is suggested to run `npm run package/lint`.'
exit 1
fi

fixup-check:
name: Block fixup and squash commits
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@
[#1051](https://github.com/nextcloud/cookbook/pull/1051) @christianlupus

### Codebase maintenance
- Removed codecov.io upload of intermediate merge commits during pull requests [#1028](https://github.com/nextcloud/cookbook/issues/1028)
- Removed codecov.io upload of intermediate merge commits during pull requests
[#1028](https://github.com/nextcloud/cookbook/issues/1028)
- Use latest possible NC core for CI tests
- Introduce migration tests
- Enable automatically merging of dependabot PRs
- Add code style checker for package.json
[#1053](https://github.com/nextcloud/cookbook/pull/1053) @christianlupus

### Documentation
- Add documentation on updates of the API endpoints
Expand Down
187 changes: 187 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading