Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3S4mur41 committed Mar 28, 2022
1 parent 80154e8 commit 6f47794
Show file tree
Hide file tree
Showing 12 changed files with 753 additions and 1,095 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# the repo. Unless a later match takes precedence,
# Owners will be requested for review when someone opens a pull request.

* @Th3S4mur41
* @Th3S4mur41
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ updates:
interval: 'daily'
time: '00:00'
timezone: 'Europe/Berlin'
# reviewers:
# - 'Th3S4mur41'
reviewers:
- 'Th3S4mur41'
15 changes: 11 additions & 4 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# This is the workflow for the pull request
# This is the workflow to automatically approve and merge dependabot PRs
#
name: Dependabot automation

on:
pull_request:
# Allows you to call this workflow from other workflows
workflow_call:
secrets:
GH_TOKEN:
required: false

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
pull-requests: write
Expand All @@ -28,14 +35,14 @@ jobs:
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Approve a PR
continue-on-error: true
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN | secrets.GITHUB_TOKEN }} # Needed to push to GitHub

- name: '🧹 Cleanup workspace'
uses: ATOS-Actions/clean-self-hosted-runner@v1
32 changes: 3 additions & 29 deletions .github/workflows/validate.yml → .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Validate
# This is the workflow to lint the source code
name: Lint Code

# Controls when the action will run.
on:
Expand All @@ -10,9 +11,8 @@ on:

jobs:
lint:
name: '🕵️‍♂️ Lint'
name: '🕵️‍♂️ Lint Code'
runs-on: ubuntu-latest
# container: node:lts-bullseye

steps:
- name: '☁️ Checkout repository'
Expand All @@ -34,29 +34,3 @@ jobs:

- name: '🧹 Cleanup workspace'
uses: ATOS-Actions/clean-self-hosted-runner@v1

test:
name: '🧪 Test'
needs: [lint]
runs-on: ubuntu-latest

steps:
- name: '☁️ Checkout repository'
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: '⚙️ Use Node.js'
uses: actions/setup-node@v2
with:
check-latest: true

- name: '⛓️ Install dependencies'
run: npm ci --no-optional --no-audit --prefer-offline --progress=false

- name: '✅ Test code'
run: npm run test

- name: '🧹 Cleanup workspace'
uses: ATOS-Actions/clean-self-hosted-runner@v1
31 changes: 31 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is the workflow to validate a PR
#
name: Lint Pull Request

on:
pull_request_target:
types: [opened, synchronize, reopened]

jobs:
lint-pr:
name: '🕵️‍♂️ Lint Commit Message'
runs-on: ubuntu-latest
# container: node:lts-bullseye

steps:
- name: '☁️ Checkout repository'
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

# check for the most recent release: https://github.com/Namchee/conventional-pr/releases
- name: '✅ Lint PR'
uses: Namchee/conventional-pr@v0.9.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
label: '⁉️ invalid'
branch_pattern: ''

- name: '🧹 Cleanup workspace'
uses: ATOS-Actions/clean-self-hosted-runner@v1
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is workflow runs on PR
#
name: Pull request

# Controls when the action will run.
on:
# Trigger workflow for pull requests.
pull_request_target:
types: [opened, synchronize, reopened]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint-pr:
name: '🕵️‍♂️ Lint PR'
uses: ./.github/workflows/lint-pr.yml

lint-code:
name: '🕵️‍♂️ Lint code'
uses: ./.github/workflows/lint-code.yml

dependabot:
name: '🤖 Dependabot automation'
uses: ./.github/workflows/dependabot.yml
38 changes: 0 additions & 38 deletions .github/workflows/pull_request.yml

This file was deleted.

29 changes: 15 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# This is the workflow for the CI/CD and release
# This is the workflow to trigger a release
#
name: Release

on:
push:
branches:
- main
- next
- beta
- alpha
# Allows you to call this workflow from other workflows
workflow_call:
secrets:
GH_TOKEN:
required: false

jobs:
validate:
uses: ./.github/workflows/validate.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
release:
name: '🏷️ Release'
needs: [validate]
runs-on: ubuntu-latest
# container: node:lts-bullseye

environment:
name: production
Expand Down Expand Up @@ -47,12 +44,16 @@ jobs:
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Needed to push to GitHub
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Needed to publish to NPM
GH_TOKEN: ${{ secrets.GH_TOKEN | secrets.GITHUB_TOKEN }} # Needed to push to GitHub
HUSKY: 0 # disable pre-commit hooks
run: |
npm run release
echo "::set-output name=version::$(npm run env | grep npm_package_version | cut -d '=' -f 2)"
- name: '📦 Update major version'
uses: Actions-R-Us/actions-tagger@latest
with:
publish_latest_tag: true

- name: '🧹 Cleanup workspace'
uses: ATOS-Actions/clean-self-hosted-runner@v1
6 changes: 0 additions & 6 deletions CHANGELOG.md

This file was deleted.

18 changes: 0 additions & 18 deletions action.yml

This file was deleted.

Loading

0 comments on commit 6f47794

Please sign in to comment.