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

Upgrade to actions v2 #18

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ indent_size = 2
[*.json]
indent_size = 2

[*.yml]
indent_size = 2

[{package.json,package-lock.json}]
end_of_line = lf

[*.workflow]
indent_size = 2
18 changes: 0 additions & 18 deletions .github/main.workflow

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: push

name: CI

jobs:
lint:
name: Lint

runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@master

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Version Information
run: |
node --version
npm --version

- name: Install Dependencies
run: npm ci

- name: ESLint
run: npm test
18 changes: 4 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@ FROM node:12-alpine
LABEL "name"="eslint-action"
LABEL "version"="1.0.0"

# Labels for GitHub to read the action
LABEL "com.github.actions.name"="ESLint action with annotations"
LABEL "com.github.actions.description"="An action that runs ESLint and creates annotations for errors and warnings"
LABEL "com.github.actions.icon"="award"
LABEL "com.github.actions.color"="green"

# Labels for GitHub to publish the action
LABEL "repository"="https://github.com/xt0rted/eslint-action"
LABEL "homepage"="https://github.com/xt0rted/eslint-action"
LABEL "maintainer"="Brian Surowiec"

# Copy the action's code
COPY LICENSE README.md /
COPY package*.json /
COPY *.js /
COPY entrypoint.sh /entrypoint.sh

# Set execute permissions
RUN npm ci --only=production

RUN chmod +x /entrypoint.sh

# Run `entrypoint.sh`
ENTRYPOINT ["/entrypoint.sh"]
27 changes: 27 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "ESLint With Annotations"

description: "An action that runs ESLint and creates annotations for errors and warnings"

author: "xt0rted"

branding:
icon: "award"
color: "green"

inputs:
repo-token:
description: The GITHUB_TOKEN secret
required: true

args:
description: The arguments to pass to ESLint
required: false
default: ./

working_directory:
description: The optional directory to run the action in
required: false

runs:
using: "docker"
image: "Dockerfile"
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
#!/bin/sh -l

set -e

node --version

if [ -n "$RUN_DIR" ]; then
NODE_PATH="$RUN_DIR/node_modules" node /run.js $*
if [ -n "$INPUT_WORKING_DIRECTORY" ]; then
NODE_PATH="$INPUT_WORKING_DIRECTORY/node_modules" node /run.js $*
else
NODE_PATH=node_modules node /run.js $*
fi
Loading