-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add info.xml lint to replace occ app:check
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
- Loading branch information
Showing
4 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# This workflow needs to be run on demand | ||
# It will search for all repositories containing the provided | ||
# action and open pull requests if necessary. | ||
|
||
name: Update npm engines versions | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
repositories: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
matrix: ${{ steps.search-repos.outputs.matrix }} | ||
|
||
steps: | ||
- name: Check actor permission | ||
uses: skjnldsv/check-actor-permission@v2 | ||
with: | ||
require: admin | ||
|
||
- name: Search repositories using a package.json | ||
id: search-repos | ||
# This is a simple curl to fetch the list of repos containing a file and extracting the repo names | ||
# We check if the file is <50KB to ignore the lockfile | ||
run: | | ||
echo '' > repos.json | ||
# Retrieve first 10 potential results pages | ||
for i in {0..10}; do | ||
RESULTS=$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/search/code?q=org%3A${{ github.repository_owner }}+size%3A<50000+filename%3Apackage.json&per_page=100&page=$i" | jq -c '.items') | ||
if [ "$RESULTS" = "null" ]; then | ||
echo "Stopped on page $i" | ||
break | ||
fi | ||
echo "$RESULTS" >> repos.json | ||
done | ||
# Pipe all results arrays and filter duplicate | ||
REPOS=$(cat repos.json | jq '.[]' | jq -sc 'map(.repository.name) | unique') | ||
echo "::set-output name=matrix::$REPOS" | ||
dispatch: | ||
runs-on: ubuntu-latest | ||
needs: repositories | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
repositories: ${{ fromJSON(needs.repositories.outputs.matrix) }} | ||
|
||
env: | ||
NODE_VERSION: "^14.0.0" | ||
NPM_VERSION: "^7.0.0" | ||
|
||
steps: | ||
- name: Checkout target repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.repository_owner }}/${{ matrix.repositories }} | ||
|
||
- name: Set node version to ${{ env.NODE_VERSION }} | ||
run: jq --tab '.engines.node = "${{ env.NODE_VERSION }}"' package.json > package-new.json && mv package-new.json package.json | ||
|
||
- name: Set npm version to ${{ env.NPM_VERSION }} | ||
run: jq --tab '.engines.npm = "${{ env.NPM_VERSION }}"' package.json > package-new.json && mv package-new.json package.json | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
body: Automated update of the npm and node engines versions | ||
branch: feat/package-node-npm-engines-update | ||
commit-message: Update npm and node engines versions | ||
committer: Nextcloud bot <bot@nextcloud.com> | ||
author: Nextcloud bot <bot@nextcloud.com> | ||
signoff: true | ||
title: Update npm and node engines versions | ||
labels: dependencies | ||
token: ${{ secrets.COMMAND_BOT_PAT }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "Linting info.xml", | ||
"description": "info.xml app linting based on the app-info template", | ||
"iconName": "lint-info-xml", | ||
"categories": [ | ||
"XML" | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow is provided via the organization template repository | ||
# | ||
# https://github.com/nextcloud/.github | ||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | ||
|
||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- stable* | ||
|
||
jobs: | ||
xml-linters: | ||
runs-on: ubuntu-latest | ||
|
||
name: info.xml lint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Download schema | ||
run: wget https://raw.githubusercontent.com/nextcloud/server/master/resources/app-info-shipped.xsd | ||
|
||
- name: Lint info.xml | ||
uses: ChristophWurst/xmllint-action@v1 | ||
with: | ||
xml-file: ./appinfo/info.xml | ||
xml-schema-file: ./app-info-shipped.xsd |