Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from byu-oit/ci
Browse files Browse the repository at this point in the history
added ci workflow
  • Loading branch information
yoshutch authored Jul 2, 2020
2 parents 61e8e99 + 8b6566c commit fcfecf5
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI
on:
pull_request:
push:
branches:
- master
- 'v*'
env:
node_version: "12.x"

jobs:
build: # make sure build/ci work properly
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}

- name: npm install
run: npm install

- name: npm build
run: npm build

- name: npm run pack
run: npm run package

audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}

- name: npm audit
run: npm audit --audit-level=critical

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}

- name: npm install
run: npm install

- name: npm lint
run: npm run lint

# When tests are added to the code uncomment
# test-code:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up Node.js
# uses: actions/setup-node@v1
# with:
# node-version: ${{ env.node_version }}
#
# - name: npm install
# run: npm install
#
# - name: npm test
# run: npm test
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
![CI](https://github.com/byu-oit/github-action-disallow-concurrent-runs/workflows/CI/badge.svg)
![Test](https://github.com/byu-oit/github-action-disallow-concurrent-runs/workflows/Test/badge.svg)

# ![BYU logo](https://www.hscripts.com/freeimages/logos/university-logos/byu/byu-logo-clipart-128.gif) github-action-disallow-concurrent-runs
A GitHub Action for disallowing concurrent workflow runs

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function run () {
const token = getInput('token', { required: true })
const octokit = new github.GitHub(token)

const { repo: { owner, repo }, workflow: workflowName, payload: { ref }, sha } = github.context
const { repo: { owner, repo }, workflow: workflowName, payload: { ref } } = github.context
const branch = ref.slice('refs/heads/'.length) // ref = 'refs/heads/master'

const { data: { workflows } } = await octokit.actions.listRepoWorkflows({
Expand Down

0 comments on commit fcfecf5

Please sign in to comment.