diff --git a/.github/workflows/lint-yaml.yml b/.github/workflows/lint-yaml.yml new file mode 100644 index 00000000..41583e72 --- /dev/null +++ b/.github/workflows/lint-yaml.yml @@ -0,0 +1,24 @@ +name: Lint + +on: + pull_request: + push: + branches: + - master + +jobs: + yaml-lint: + runs-on: ubuntu-latest + + name: yaml + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Github action templates lint + uses: ibiqlik/action-yamllint@v3 + with: + file_or_dir: workflow-templates + config_data: | + line-length: warning diff --git a/workflow-templates/command-rebase.yml b/workflow-templates/command-rebase.yml index 9ca03262..cd5551e0 100644 --- a/workflow-templates/command-rebase.yml +++ b/workflow-templates/command-rebase.yml @@ -7,7 +7,7 @@ name: Automatic rebase on: issue_comment: - types: [ created ] + types: created jobs: rebase: @@ -29,8 +29,9 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Automatic Rebase uses: cirrus-actions/rebase@1.5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/workflow-templates/dependabot-approve-merge.yml b/workflow-templates/dependabot-approve-merge.yml index 6c5d7373..c8d69da5 100644 --- a/workflow-templates/dependabot-approve-merge.yml +++ b/workflow-templates/dependabot-approve-merge.yml @@ -7,7 +7,7 @@ name: Dependabot on: pull_request_target: - branches: + branches: - master - stable* @@ -17,13 +17,13 @@ jobs: steps: # Default github action approve - uses: hmarr/auto-approve-action@v2 - if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + if: github.actor == 'dependabot[bot]' with: github-token: ${{ secrets.GITHUB_TOKEN }} # Nextcloud bot approve and merge request - uses: ahmadnassri/action-dependabot-auto-merge@v2 - if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + if: github.actor == 'dependabot[bot]' with: target: minor github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }} diff --git a/workflow-templates/node.yml b/workflow-templates/node.yml index aebed2cb..4b20eb5e 100644 --- a/workflow-templates/node.yml +++ b/workflow-templates/node.yml @@ -23,18 +23,18 @@ jobs: - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@v1.1 - id: package-engines-versions + id: versions with: fallbackNode: '^12' fallbackNpm: '^6' - - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} uses: actions/setup-node@v2 with: - node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.nodeVersion }} - - name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}" + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - name: Install dependencies & build run: | @@ -43,4 +43,10 @@ jobs: - name: Check webpack build changes run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" + bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff