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

Lint action templates #11

Merged
merged 1 commit into from
Jul 5, 2021
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
24 changes: 24 additions & 0 deletions .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions workflow-templates/command-rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Automatic rebase

on:
issue_comment:
types: [ created ]
types: created

jobs:
rebase:
Expand All @@ -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 }}

6 changes: 3 additions & 3 deletions workflow-templates/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Dependabot

on:
pull_request_target:
branches:
branches:
- master
- stable*

Expand All @@ -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 }}
18 changes: 12 additions & 6 deletions workflow-templates/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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