Skip to content

Commit

Permalink
feat: set github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
satya-auti committed Jan 8, 2024
1 parent d089406 commit 3914bd8
Show file tree
Hide file tree
Showing 5 changed files with 1,561 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/'
schedule:
interval: daily
time: '00:00'
reviewers:
- satya-auti
assignees:
- satya-auti
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/media'
schedule:
interval: daily
time: '00:00'
reviewers:
- satya-auti
assignees:
- satya-auti
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- satya-auti
assignees:
- satya-auti
commit-message:
prefix: fix
prefix-development: chore
include: scope
36 changes: 36 additions & 0 deletions .github/workflows/automerger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Automerge Dependabot PRs'

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata 🤖
id: metadata
uses: dependabot/[email protected]
with:
alert-lookup: true
compat-lookup: true
github-token: ${{ secrets.DEPENDABOT_TOKEN }}

- name: Authenticate CLI with PAT 🔐
run: echo "${{ secrets.DEPENDABOT_TOKEN }}" | gh auth login --with-token

- name: Approve Dependabot PRs 👍
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}

- name: Auto-merge Dependabot PRs 🕺
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Continuous Integration'

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
checks: write
contents: read

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository ✨ (non dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v4

- name: Check out repository 🎉 (dependabot)
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env 📦
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit

- name: Run linter(s) 👀
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
auto_fix: false
continue_on_error: false
neutral_check_on_warning: true
stylelint: true
stylelint_extensions: css,scss,vue
eslint: true
eslint_extensions: js,ts,vue
prettier: true
prettier_extensions: js,ts,vue

- name: Build the package 🎉
run: npm run build
Loading

0 comments on commit 3914bd8

Please sign in to comment.