Skip to content

🌬️ A GitHub Action to read an arbitrary file and either output it or use it in another GitHub Action. πŸƒ

License

Notifications You must be signed in to change notification settings

igorskyflyer/action-readfile

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

readfile()

🌬️ A GitHub Action to read an arbitrary file and either output it or use it in another GitHub Action (step). πŸƒ


πŸ’– Support further development

I work hard for every project, including this one and your support means a lot to me!
Consider buying me a coffee. β˜•
Thank you for supporting my efforts! πŸ™πŸ˜Š


Donate to igorskyflyer

@igorskyflyer


πŸ€ΉπŸΌβ€β™‚οΈ Usage

In order to use this Action you need to create a YAML (.yml) file in your repository's .github/workflows/ directory.

Here's an example.


.github/workflows/read-file.yml

name: Read file

on:
  [push]

jobs:
  read_file:
    runs-on: ubuntu-latest # windows-latest || macos-latest
    name: Read arbitrary file

    steps:
     # do not remove this step,
     # it is necessary
      - name: Checkout repository
        uses: actions/checkout@v4
        
      - name: Read arbitrary file
        id: file
        uses: igorskyflyer/action-readfile@v1.0.0
        with:
          path: './test.txt'
      
      - name: Output file
        env:
          FILE_CONTENTS: ${{ steps.file.outputs.content }}
        # print the output directly (1)
        # or via an environment variable (2)
        run: |
          echo 'File contents:'
          echo "${{ steps.file.outputs.content }}"
          echo "$FILE_CONTENTS"

βš™οΈ Configuration

path: string, required

The path of the file to read, relative to the current working directory i.e. the repository where the Action is installed.


πŸͺͺ License

Licensed under the MIT license which is available here, MIT license.


🧬 Related

simple-exec

πŸ•Ί Command. Execution. Made. Simple. β–Ά

@igor.dvlpr/recursive-readdir

πŸ“– Provides recursive readdir() and readdirSync() functions. πŸ“

@igor.dvlpr/keppo

🎑 Parse, manage, compare and output SemVer-compatible version numbers. πŸ›‘

@igor.dvlpr/odin

πŸ”± Odin is an Object wrapper that allows you to create objects and set their attributes - all at once! πŸ”Ί

@igor.dvlpr/aria

🧬 Meet Aria, an efficient Adblock filter list compiler, with many features that make your maintenance of Adblock filter lists a breeze! πŸ—‘