Skip to content

Commit 2a41b53

Browse files
committed
ci(workflows): add reusable workflows
1 parent ed4c7eb commit 2a41b53

File tree

4 files changed

+33
-101
lines changed

4 files changed

+33
-101
lines changed

.github/workflows/auto-merge.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Dependabot auto-merge
2+
3+
on: pull_request_target
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
9+
jobs:
10+
dependabot:
11+
uses: ryansonshine/ryansonshine/.github/workflows/automerge.yml@main
12+
secrets:
13+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,16 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
1+
# Reusable workflow for code analysis; to eject, you can replace this file with
2+
# https://github.com/ryansonshine/ryansonshine/blob/main/.github/workflows/codeql-analysis.yml
123
name: "CodeQL"
134

145
on:
156
push:
16-
branches: [ main ]
7+
branches: [main]
178
pull_request:
189
# The branches below must be a subset of the branches above
19-
branches: [ main ]
10+
branches: [main]
2011
schedule:
21-
- cron: '39 3 * * 6'
12+
- cron: "36 7 * * 6"
2213

2314
jobs:
2415
analyze:
25-
name: Analyze
26-
runs-on: ubuntu-latest
27-
permissions:
28-
actions: read
29-
contents: read
30-
security-events: write
31-
32-
strategy:
33-
fail-fast: false
34-
matrix:
35-
language: [ 'javascript' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37-
# Learn more:
38-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39-
40-
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
43-
44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53-
54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
58-
59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
61-
62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
65-
66-
#- run: |
67-
# make bootstrap
68-
# make release
69-
70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
16+
uses: ryansonshine/ryansonshine/.github/workflows/codeql-analysis.yml@main

.github/workflows/pr.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1+
# Reusable workflow for PRs; to eject, you can replace this file with
2+
# https://github.com/ryansonshine/ryansonshine/blob/main/.github/workflows/pr.yml
13
name: Pull Request
24

35
on: [pull_request]
46

57
jobs:
68
build:
7-
runs-on: ubuntu-latest
8-
9-
strategy:
10-
matrix:
11-
node-version: [12.x, 14.x, 16.x]
12-
13-
steps:
14-
- uses: actions/checkout@v2
15-
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: ${{ matrix.node-version }}
19-
- run: npm ci
20-
- run: npm run build --if-present
21-
- run: npm test
22-
- run: npm run coverage
9+
uses: ryansonshine/ryansonshine/.github/workflows/pr.yml@main

.github/workflows/release.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1+
# Reusable workflow for releases; to eject, you can replace this file with
2+
# https://github.com/ryansonshine/ryansonshine/blob/main/.github/workflows/release.yml
13
name: Release
24
on:
5+
workflow_dispatch:
36
push:
47
branches:
58
- main
9+
610
jobs:
711
release:
8-
name: Release
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v2
13-
with:
14-
fetch-depth: 0
15-
- name: Setup Node.js
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: lts/*
19-
- name: Install dependencies
20-
run: npm ci
21-
- name: Test
22-
run: npm test
23-
- name: Build
24-
run: npm run build
25-
- name: Release
26-
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29-
run: npx semantic-release
30-
- name: Code Coverage
31-
run: npm run coverage
12+
permissions:
13+
contents: write
14+
issues: write
15+
pull-requests: write
16+
uses: ryansonshine/ryansonshine/.github/workflows/release.yml@main
17+
secrets:
18+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)