initial commit

This commit is contained in:
Julian Gruber
2020-03-03 11:35:53 +01:00
commit b17a6cf4d9
8 changed files with 16863 additions and 0 deletions

15
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
npm ci
npm run build
- uses: ./
with:
path: package.json

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

20
README.md Normal file
View File

@@ -0,0 +1,20 @@
# read-file-action
Read file contents.
## Usage
```yaml
steps:
- name: Read package.json
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./package.json
- name: Echo package.json
run: echo ${{ steps.package.outputs.content }}
```
## License
MIT

16
action.yml Normal file
View File

@@ -0,0 +1,16 @@
name: Read file
author: juliangruber
description: 'Read file contents'
branding:
icon: 'file'
color: purple
inputs:
path:
description: 'File path'
required: true
outputs:
content:
description: 'File content'
runs:
using: 'node12'
main: 'dist/index.js'

11233
dist/index.js vendored Normal file

File diff suppressed because one or more lines are too long

12
index.js Normal file
View File

@@ -0,0 +1,12 @@
'use strict'
const core = require('@actions/core')
const { promises: fs } = require('fs')
const main = async () => {
const path = core.getInput('path')
const content = await fs.readFile(path, 'utf8')
core.setOutput('content', content)
}
main().catch(err => core.setFailed(err.message))

5540
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

26
package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "read-file-action",
"private": true,
"version": "0.0.0",
"license": "MIT",
"description": "Read file contents",
"repository": "juliangruber/read-file-action",
"scripts": {
"test": "prettier-standard index.js && standard index.js",
"build": "ncc build index.js",
"version": "npm run build && git add dist",
"release": "np && git tag -f v1 && git push --tags -f"
},
"np": {
"publish": false
},
"dependencies": {
"@actions/core": "^1.2.0"
},
"devDependencies": {
"@zeit/ncc": "^0.20.5",
"np": "^5.1.3",
"prettier-standard": "^15.0.1",
"standard": "^14.3.1"
}
}