Skip to content
Merged
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
58 changes: 29 additions & 29 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 50
assignees:
- "guibranco"
reviewers:
- "guibranco"
labels:
- "npm"
- "javascript"
- "dependencies"
groups:
TSESLint:
patterns:
- "*typescript-eslint*"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 50
assignees:
- 'guibranco'
reviewers:
- 'guibranco'
labels:
- 'npm'
- 'javascript'
- 'dependencies'
groups:
TSESLint:
patterns:
- '*typescript-eslint*'

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 50
assignees:
- "guibranco"
reviewers:
- "guibranco"
labels:
- "github-actions"
- "dependencies"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 50
assignees:
- 'guibranco'
reviewers:
- 'guibranco'
labels:
- 'github-actions'
- 'dependencies'
2 changes: 1 addition & 1 deletion .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ rules:
level: warning
max: 80
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
allow-non-breakable-inline-mappings: true
8 changes: 4 additions & 4 deletions .github/linters/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jest from 'eslint-plugin-jest'
import githubPlugin from 'eslint-plugin-github';
import prettierPlugin from 'eslint-plugin-prettier';
import githubPlugin from 'eslint-plugin-github'
import prettierPlugin from 'eslint-plugin-prettier'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'
Expand Down Expand Up @@ -33,7 +33,7 @@ export default [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:jest/recommended'
),
{
plugins: {
Expand All @@ -47,7 +47,7 @@ export default [
...globals.jest,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
BufferEncoding: 'readonly',
BufferEncoding: 'readonly'
},

parser: tsParser,
Expand Down
14 changes: 3 additions & 11 deletions .github/linters/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
"compilerOptions": {
"noEmit": true
},
"include": [
"../../__tests__/**/*",
"../../src/**/*"
],
"exclude": [
"../../dist",
"../../node_modules",
"../../coverage",
"*.json"
]
}
"include": ["../../__tests__/**/*", "../../src/**/*"],
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"]
}
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
id: test-action
uses: ./
with:
path: "README.md"
path: 'README.md'

- name: Print Output
id: output
Expand All @@ -67,7 +67,6 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -76,7 +75,7 @@ jobs:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: "6.x"
versionSpec: '6.x'

- name: Determine Version
id: gitversion
Expand All @@ -92,4 +91,6 @@ jobs:
tag: v${{ steps.gitversion.outputs.semVer }}
name: Release v${{ steps.gitversion.outputs.semVer }}
generateReleaseNotes: true
body: Release ${{ steps.gitversion.outputs.semVer }} of ${{ github.event.repository.name }}
body:
Release ${{ steps.gitversion.outputs.semVer }} of ${{
github.event.repository.name }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Lint Code Base
id: super-linter
uses: super-linter/super-linter/slim@v6
uses: super-linter/super-linter/slim@v8
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/size-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
pull-requests: write

steps:

- name: size-label
uses: "pascalgn/size-label-action@v0.5.5"
uses: 'pascalgn/size-label-action@v0.5.5'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"proseWrap": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
}
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "guibranco",
"projectKey": "guibranco_github-file-reader-action-v2"
}
}
"sonarlint.connectedMode.project": {
"connectionId": "guibranco",
"projectKey": "guibranco_github-file-reader-action-v2"
}
}
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# GitHub File Reader Action V2

[![GitHub repo](https://img.shields.io/badge/GitHub-guibranco%2Fgithub--file--reader--action--v2-green.svg?style=plastic&logo=github)](https://github.com/guibranco/github-file-reader-action-v2 "shields.io")
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/guibranco/github-file-reader-action-v2?color=green&label=Code%20size&style=plastic&logo=github)](https://github.com/guibranco/github-file-reader-action-v2 "shields.io")
[![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/github-file-reader-action-v2?color=green&logo=github&style=plastic&label=Last%20commit)](https://github.com/guibranco/github-file-reader-action-v2 "shields.io")
[![GitHub license](https://img.shields.io/github/license/guibranco/github-file-reader-action-v2?color=green&logo=github&style=plastic&label=License)](https://github.com/guibranco/github-file-reader-action-v2 "shields.io")
[![GitHub repo](https://img.shields.io/badge/GitHub-guibranco%2Fgithub--file--reader--action--v2-green.svg?style=plastic&logo=github)](https://github.com/guibranco/github-file-reader-action-v2 'shields.io')
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/guibranco/github-file-reader-action-v2?color=green&label=Code%20size&style=plastic&logo=github)](https://github.com/guibranco/github-file-reader-action-v2 'shields.io')
[![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/github-file-reader-action-v2?color=green&logo=github&style=plastic&label=Last%20commit)](https://github.com/guibranco/github-file-reader-action-v2 'shields.io')
[![GitHub license](https://img.shields.io/github/license/guibranco/github-file-reader-action-v2?color=green&logo=github&style=plastic&label=License)](https://github.com/guibranco/github-file-reader-action-v2 'shields.io')

![Check Dist](https://github.com/guibranco/github-file-reader-action-v2/actions/workflows/check-dist.yml/badge.svg)
![CI](https://github.com/guibranco/github-file-reader-action-v2/actions/workflows/ci.yml/badge.svg)
Expand All @@ -15,30 +15,36 @@ GitHub Action to read the contents of a file

> [!Important]
>
> **Disclaimer:** This version was created because the creator has not updated the [original (V1)](https://github.com/andstor/file-reader-action) for a while.
> **Disclaimer:** This version was created because the creator has not updated
> the [original (V1)](https://github.com/andstor/file-reader-action) for a
> while.

This is a GitHub Action that reads a file's contents. If you give it a path to a file, it will provide its contents and file size, accessible through an output variable.
This is a GitHub Action that reads a file's contents. If you give it a path to a
file, it will provide its contents and file size, accessible through an output
variable.

## Usage

The following example [workflow step](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow) will read the contents of the `package.json` file.
The following example
[workflow step](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow)
will read the contents of the `package.json` file.

```yml
- name: "Read file contents"
- name: 'Read file contents'
uses: guibranco/github-file-reader-action-v2@latest
id: read_file
with:
path: "package.json"
path: 'package.json'
```

## Options ⚙️

The following input variable options can/must be configured:

|Input variable|Necessity|Description|Default|
|----|----|----|----|
|`path`|Required|the path to the file to read.||
|`encoding`|Optional|the encoding of the file to read.|`utf8`|
| Input variable | Necessity | Description | Default |
| -------------- | --------- | --------------------------------- | ------- |
| `path` | Required | the path to the file to read. | |
| `encoding` | Optional | the encoding of the file to read. | `utf8` |

## Outputs

Expand All @@ -48,7 +54,7 @@ The following input variable options can/must be configured:
## Example

```yml
name: "Read file contents"
name: 'Read file contents'

on: [push, pull_request]

Expand All @@ -63,7 +69,7 @@ jobs:
uses: guibranco/github-file-reader-action-v2@latest
id: read_file
with:
path: "package.json"
path: 'package.json'

- name: File contents
run: echo "${ steps.read_file.outputs.contents }"
Expand All @@ -74,6 +80,8 @@ jobs:

## License

Copyright © 2024 [André Storhaug](https://github.com/andstor), [GuiBranco](https://github.com/guibranco).
Copyright © 2024 [André Storhaug](https://github.com/andstor),
[GuiBranco](https://github.com/guibranco).

file-reader-action-v2 is licensed under the [MIT License](https://github.com/guibranco/github-file-reader-action-v2/blob/main/LICENSE).
file-reader-action-v2 is licensed under the
[MIT License](https://github.com/guibranco/github-file-reader-action-v2/blob/main/LICENSE).
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
theme: jekyll-theme-cayman
title: "📄 :octocat: GitHub Action to read the contents of a file"
description: "GitHub Action to read the contents of a file."
title: '📄 :octocat: GitHub Action to read the contents of a file'
description: 'GitHub Action to read the contents of a file.'
show_downloads: true
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"newLine": "lf"
},
"exclude": ["./dist", "./node_modules", "./__tests__", "./coverage"]
}
}
Loading