jaywcjlove / jaywcjlove/github-action-read-file

Recursively read files in directory/path into JSON output

Open
#12 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I do have a GitHub repository for a Mozilla Firefox add-on (WebExtension). It does have changelog data listed in the repository in the following structure (see live in https://github.com/rugk/mastodon-simplified-federation/tree/main/assets/texts):

```shell
$ ls -a assets/texts
. .. de en fr pt_BR
$ cat assets/texts/en/Changelog/2.2.html


  • New: The translation for Dutch has been added, see #118.

  • Fixed:: Fixed problem sometimes duplicating tabs when interacting with Mastodon instances, see #117.

More information on GitHub.
```

So for the given example, if I have a fixed version number (which is possible to find out) I want an output like this:
```yaml
{
"en": "",
"de": ""
# etc.
}
```

So, the structure is always the same and I want to read all the content in a GitHub action and put it into a JSON format.

It should then be passed as a changelog/release notes into the following GitHub Action:
```yaml
steps:
- uses: wdzeng/firefox-addon@v1.1.0-alpha.0
with:
addon-guid: your-addon's-guid
xpi-path: your-addon.zip
self-hosted: false
release-notes: {"en-US":"foo"}
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }}
```

https://github.com/wdzeng/firefox-addon/issues/2#issuecomment-2040386656

## Idea

A real action to read multiple files would be great and simplify stuff here.

In my case [I asked ChatGPT and got a quite complicated script](https://chat.openai.com/share/26f3c54e-3d38-476e-bb87-9cea84e0ce97).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named. Start by inspecting the repository's GitHub Action inputs and output handling, then trace how file contents are currently read. Done means recursively reading the requested directory structure and producing JSON keyed by directory or locale with each file's content.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.