Skip to content

Commit 9a21c88

Browse files
Fix dependencies (#52)
Co-authored-by: Guilherme Branco Stracini <[email protected]>
1 parent 7540ca0 commit 9a21c88

File tree

8 files changed

+64
-42
lines changed

8 files changed

+64
-42
lines changed

.github/linters/.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
globals:
77
Atomics: readonly
88
SharedArrayBuffer: readonly
9+
BufferEncoding: readonly
910

1011
ignorePatterns:
1112
- '!.*'

.github/workflows/check-dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# This workflow will fail if the checked-in `dist/index.js` file does not match
88
# what is expected from the build.
9-
name: Check dist/
9+
name: Check dist
1010

1111
on:
1212
push:
@@ -21,7 +21,7 @@ on:
2121

2222
jobs:
2323
check-dist:
24-
name: Check dist/
24+
name: Check dist
2525
runs-on: ubuntu-latest
2626

2727
permissions:

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,21 @@ jobs:
5656

5757
- name: Print Output
5858
id: output
59-
run: echo "${{ steps.test-action.outputs.contents }}"
59+
run: echo "${{ steps.test-action.outputs.contents }}"
60+
61+
create-release:
62+
name: Create release
63+
needs: [test-typescript, test-action]
64+
runs-on: ubuntu-latest
65+
steps:
66+
67+
- name: Create Release
68+
uses: ncipollo/[email protected]
69+
with:
70+
allowUpdates: false
71+
draft: false
72+
makeLatest: true
73+
tag: v2.0.${{ github.run_number }}
74+
name: Release v2.0.${{ github.run_number }}
75+
generateReleaseNotes: true
76+
body: Release 2.0.${{ github.run_number }} of GitHub Actions File Reader V2

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<p align="center">
2-
<a href="https://github.com/GuiBranco/github-file-reader-action-v2"><img alt="github-file-reader-action-v2 status" src="https://github.com/GuiBranco/github-file-reader-action-v2/workflows/build/badge.svg"></a>
3-
<a href="https://wakatime.com/badge/github/guibranco/github-file-reader-action-v2"><img src="https://wakatime.com/badge/github/guibranco/github-file-reader-action-v2.svg" alt="wakatime"></a>
2+
<a href="https://github.com/guibranco/github-file-reader-action-v2">
3+
<img src="https://github.com/guibranco/github-file-reader-action-v2/actions/workflows/ci.yml/badge.svg" alt="CI status">
4+
</a>
5+
<a href="https://github.com/guibranco/github-file-reader-action-v2">
6+
<img src="https://github.com/guibranco/github-file-reader-action-v2/actions/workflows/linter.yml/badge.svg" alt="Linter status">
7+
</a>
8+
<a href="https://wakatime.com/badge/github/guibranco/github-file-reader-action-v2">
9+
<img src="https://wakatime.com/badge/github/guibranco/github-file-reader-action-v2.svg" alt="wakatime">
10+
</a>
411
</p>
512

613
# GitHub File Reader Action V2
@@ -9,7 +16,7 @@ GitHub Action to read the contents of a file
916

1017
> **Warning**
1118
>
12-
> **Disclaimer** This version was created because the [original (V1)](https://github.com/andstor/file-reader-action) has not been updated by the creator for a while.
19+
> **Disclaimer:** This version was created because the [original (V1)](https://github.com/andstor/file-reader-action) has not been updated by the creator for a while.
1320
1421
This is a GitHub Action to read the contents of a file. Give it a path to a file and it provides you with the file's contents, accessible through an output variable.
1522

@@ -19,7 +26,7 @@ The following example [workflow step](https://help.github.com/en/actions/configu
1926

2027
```yml
2128
- name: "Read file contents"
22-
uses: guibranco/github-file-reader-action-v2@v2.0.3
29+
uses: guibranco/file-reader-action-v2@latest
2330
with:
2431
path: "package.json"
2532
```
@@ -52,7 +59,7 @@ jobs:
5259
uses: actions/checkout@v1
5360
5461
- name: Read file contents
55-
uses: guibranco/github-file-reader-action-v2@v2.0.3
62+
uses: guibranco/file-reader-action-v2@latest
5663
with:
5764
path: "package.json"
5865
@@ -62,6 +69,6 @@ jobs:
6269

6370
## License
6471

65-
Copyright © 2020 [André Storhaug](https://github.com/andstor), [GuiBranco](https://github.com/guibranco).
72+
Copyright © 2023 [André Storhaug](https://github.com/andstor), [GuiBranco](https://github.com/guibranco).
6673

67-
file-reader-action-v2 is licensed under the [MIT License](https://github.com/guibranco/github-file-reader-action-v2/blob/main/LICENSE).
74+
file-reader-action-v2 is licensed under the [MIT License](https://github.com/guibranco/file-reader-action-v2/blob/main/LICENSE).

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'github-file-reader-action-v2'
22
description: 'Read the contents of a file'
3-
author: 'GuiBranco'
3+
author: 'guibranco'
44
branding:
55
icon: 'file-text'
66
color: 'green'

dist/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
11
{
2-
"name": "file-reader-action-v2",
3-
"version": "2.0.1",
2+
"name": "github-file-reader-action-v2",
3+
"version": "2.0.0",
44
"private": true,
55
"description": "GitHub Action to read the contents of a file",
6-
"homepage": "https://github.com/marketplace/actions/github-file-reader-v2",
6+
"homepage": "https://github.com/marketplace/actions/github-file-reader-action-v2",
7+
"bugs": {
8+
"url": "https://github.com/guibranco/file-reader-action-v2/issues"
9+
},
710
"main": "lib/main.js",
811
"exports": {
912
".": "./dist/index.js"
1013
},
1114
"engines": {
1215
"node": ">=16"
1316
},
14-
"scripts": {
15-
"bundle": "npm run format:write && npm run package",
16-
"ci-test": "jest",
17-
"format:write": "prettier --write **/*.ts",
18-
"format:check": "prettier --check **/*.ts",
19-
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
20-
"package": "ncc build src/index.ts --license licenses.txt",
21-
"package:watch": "npm run package -- --watch",
22-
"test": "(jest && make-coverage-badge --output-path ./badges/coverage.svg) || make-coverage-badge --output-path ./badges/coverage.svg",
23-
"all": "npm run format:write && npm run lint && npm run test && npm run package"
24-
},
25-
2617
"repository": {
2718
"type": "git",
28-
"url": "git+https://github.com/guibranco/file-reader-action-v2.git"
19+
"url": "git+https://github.com/guibranco/github-file-reader-action-v2.git"
2920
},
3021
"keywords": [
3122
"actions",
3223
"file",
3324
"reader"
3425
],
3526
"author": {
36-
"name": "André Storhaug",
37-
"email": "andr3.storhaug@gmail.com",
38-
"url": "https://github.com/andstor"
27+
"name": "Guilherme Branco Stracini",
28+
"email": "guilherme@guilhermebranco.com.br",
29+
"url": "https://github.com/guibranco"
3930
},
40-
"contributors": [
41-
{
42-
"name": "Guilherme Branco Stracini",
43-
"email": "[email protected]",
44-
"url": "https://github.com/guibranco"
45-
}
46-
],
4731
"license": "MIT",
32+
"scripts": {
33+
"bundle": "npm run format:write && npm run package",
34+
"ci-test": "jest",
35+
"format:write": "prettier --write **/*.ts",
36+
"format:check": "prettier --check **/*.ts",
37+
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
38+
"package": "ncc build src/index.ts --license licenses.txt",
39+
"package:watch": "npm run package -- --watch",
40+
"test": "(jest && make-coverage-badge --output-path ./badges/coverage.svg) || make-coverage-badge --output-path ./badges/coverage.svg",
41+
"all": "npm run format:write && npm run lint && npm run test && npm run package"
42+
},
4843
"jest": {
4944
"preset": "ts-jest",
5045
"verbose": true,
@@ -74,9 +69,7 @@
7469
"./src/**"
7570
]
7671
},
77-
"bugs": {
78-
"url": "https://github.com/guibranco/file-reader-action-v2/issues"
79-
},
72+
8073
"dependencies": {
8174
"@actions/core": "^1.10.1"
8275
},

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import util from 'util'
99
export async function run(): Promise<void> {
1010
try {
1111
const filePath: string = core.getInput('path')
12+
const encoding: string = core.getInput('encoding')
1213
const readFile = util.promisify(fs.readFile)
13-
const contents = await readFile(filePath, 'utf8')
14+
const contentBuffer = await readFile(filePath, encoding as BufferEncoding)
15+
const contents: string = contentBuffer.toString()
1416
core.info(`File contents:\n${contents}`)
1517
core.setOutput('contents', contents)
1618
} catch (error: unknown) {

0 commit comments

Comments
 (0)