Skip to content

Commit

Permalink
Create action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
djdefi committed Mar 7, 2020
1 parent d00c956 commit a1da857
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# action.yml
name: 'Count Lines of Code (cloc)'
description: 'Count Lines of Code with https://github.com/AlDanial/cloc#stable-release'

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
cloc:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Install cloc
run: sudo apt-get install cloc

# Runs a set of commands using the runners shell
- name: Count Lines of Code
run: cloc $(git rev-parse HEAD) | tee -a cloc.txt

- name: Upload cloc output as a build artifact
uses: actions/upload-artifact@v1
with:
name: cloc
path: cloc.txt

branding:
icon: 'code'
color: 'blue'

0 comments on commit a1da857

Please sign in to comment.