Skip to content

Commit

Permalink
build: sync with template
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Sep 4, 2022
1 parent fb98d44 commit a990a16
Show file tree
Hide file tree
Showing 15 changed files with 466 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

root = true

[*]
Expand Down
5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

github: [ahmadnassri]
11 changes: 0 additions & 11 deletions .github/auto-merge.yml

This file was deleted.

68 changes: 67 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,77 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

version: 2
updates:
- package-ecosystem: gitsubmodule
open-pull-requests-limit: 10
directory: /
commit-message:
prefix: build
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto

- package-ecosystem: github-actions
open-pull-requests-limit: 10
directory: /
commit-message:
prefix: chore
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto

- package-ecosystem: npm
open-pull-requests-limit: 10
directory: /action
directory: /
commit-message:
prefix: build
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto

- package-ecosystem: bundler
open-pull-requests-limit: 10
directory: /
commit-message:
prefix: build
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto

- package-ecosystem: terraform
open-pull-requests-limit: 10
directory: /
commit-message:
prefix: build
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto

- package-ecosystem: docker
open-pull-requests-limit: 10
directory: /
commit-message:
prefix: build
prefix-development: chore
include: scope
schedule:
interval: daily
time: "10:00"
timezone: America/Toronto
11 changes: 11 additions & 0 deletions .github/linters/.checkov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

quiet: true
skip-check:
- CKV_DOCKER_2
- CKV_GHA_3
- BC_DKR_3
- CKV_GIT_1
- CKV_GIT_5
4 changes: 4 additions & 0 deletions .github/linters/.commit-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

extends:
- "@commitlint/config-conventional"
rules:
Expand Down
8 changes: 6 additions & 2 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

# Heading levels should only increment by one level at a time
MD001: false

Expand Down Expand Up @@ -36,7 +40,7 @@ MD012:

# Line length
MD013:
line_length: 180
line_length: 360
strict: true
stern: true

Expand Down Expand Up @@ -127,7 +131,7 @@ MD039: true
MD040: true

# First line in file should be a top level heading
MD041: true
MD041: false

# No empty links
MD042: true
Expand Down
26 changes: 26 additions & 0 deletions .github/linters/.mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

ENABLE: ACTION,BASH,MAKEFILE,REPOSITORY,TERRAFORM,HTML,ENV,JAVASCRIPT,JSX,EDITORCONFIG,JSON,DOCKERFILE,MARKDOWN,YAML,CSS,OPENAPI,SQL
DISABLE_LINTERS:
- JSON_PRETTIER
- JAVASCRIPT_PRETTIER
- YAML_PRETTIER
- REPOSITORY_TRIVY
- REPOSITORY_DEVSKIM
- TERRAFORM_CHECKOV

CONFIG_REPORTER: false
FAIL_IF_MISSING_LINTER_IN_FLAVOR: true
FLAVOR_SUGGESTIONS: false
LOG_LEVEL: INFO
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdown-lint.yml
PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true
VALIDATE_ALL_CODEBASE: false
IGNORE_GENERATED_FILES: true
FILTER_REGEX_EXCLUDE: (dist/*|README.md|test/fixtures/*|vendor/*|/schemas/*)
REPOSITORY_CHECKOV_ARGUMENTS: [--skip-path, schemas]

DISABLE_ERRORS: true # TODO: disable once https://github.com/oxsecurity/megalinter/pull/1798 is merged
17 changes: 17 additions & 0 deletions .github/linters/.yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

extends: default

rules:
brackets:
max-spaces-inside: 1
document-start:
present: false
truthy:
check-keys: false
line-length:
max: 500
comments:
min-spaces-from-content: 1
82 changes: 82 additions & 0 deletions .github/workflows/pull_request_target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ------------------------------------------------------------- #
# Note: this file is automatically managed in template-template #
# ------------------------------------------------------------- #

on: pull_request_target

name: pull_request_target

permissions:
pull-requests: write
contents: write

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}

jobs:
metadata:
runs-on: ubuntu-latest

outputs:
repository_is_template: ${{ steps.metadata.outputs.repository_is_template }}

steps:
- uses: actions/checkout@v3.0.2

- uses: ahmadnassri/action-metadata@v2.1.1
id: metadata

auto-merge:
timeout-minutes: 5

runs-on: ubuntu-latest

# only run for dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' }}

env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

steps:
- id: dependabot
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: auto merge conditions
id: auto-merge
if: |
(
steps.dependabot.outputs.update-type == 'version-update:semver-patch' &&
contains('direct:development,indirect:development,direct:production,indirect:production', steps.dependabot.outputs.dependency-type)
) || (
steps.dependabot.outputs.update-type == 'version-update:semver-minor' &&
contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type)
)
run: echo "::notice ::auto-merge conditions satisfied"

- name: auto approve pr
if: ${{ steps.auto-merge.conclusion == 'success' }}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --rebase "$PR_URL"
template-sync:
needs: metadata

timeout-minutes: 20

runs-on: ubuntu-latest

# only run for templates
if: ${{ needs.metadata.outputs.repository_is_template == 'true' }}

steps:
- uses: actions/checkout@v3.0.2
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: ahmadnassri/action-template-repository-sync@v2
with:
github-token: ${{ secrets.GH_TOKEN }}
Loading

0 comments on commit a990a16

Please sign in to comment.