https://github.com/joesiu/xlsx-to-csv-action
A GitHub action to convert .xlsx file to .csv file, with the ability to filter / rename columns
https://github.com/joesiu/xlsx-to-csv-action
action github workflow
Last synced: 3 months ago
JSON representation
A GitHub action to convert .xlsx file to .csv file, with the ability to filter / rename columns
- Host: GitHub
- URL: https://github.com/joesiu/xlsx-to-csv-action
- Owner: JoeSiu
- License: mit
- Created: 2024-02-17T10:53:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T01:41:02.000Z (about 2 years ago)
- Last Synced: 2025-02-28T23:46:37.494Z (over 1 year ago)
- Topics: action, github, workflow
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/xlsx-to-csv-action
- Size: 843 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xlsx-to-csv-action
[](https://github.com/super-linter/super-linter)

[](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml)
[](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml)
[](./badges/coverage.svg)
A GitHub action to convert `.xlsx` file to `.csv` file, with the ability to
filter / rename columns.
## Usage
Create a GitHub action workflow file, e.g., `.github/workflows/sample.yml`
### Input
| Field | Description | Required |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | -------- |
| `inputFile` | Input file path, must be a `.xlsx` file | ✅ |
| `outputDir` | Output directory | ✅ |
| `outputFilename` | Output filename | |
| `filter` | A JSON string of the columns to filter and rename
e.g., `{ "Segment": "segment", "Country": "country" }` | |
### Output
| Field | Description |
| ------------ | ------------------------------ |
| `outputFile` | Output file path of the `.csv` |
### Example
```yaml
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: xlsx To csv Action
id: xlsx-to-csv-action
uses: JoeSiu/xlsx-to-csv-action@1.0.0
with:
inputFile: './public/sample.xlsx'
outputDir: './public/'
outputFilename: 'sample-filtered'
filter: '{ "Segment": "segment", "Country": "country" }'
- name: Print Output
id: output
run: echo "${{ steps.xlsx-to-csv-action.outputs.outputFile }}"
```