Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds examples of input arrays. #645

Merged
merged 1 commit into from
Jun 28, 2024
Merged
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,29 @@ You can also use the `committer_name` and `committer_email` inputs to make it ap
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
```

### Array inputs

Due to limitations in the GitHub action APIs, all inputs must be either strings or booleans.
The action supports arrays in `add` and `remove`, but they have to be encoded as a string with a YAML flow sequence:

```yaml
- uses: EndBug/add-and-commit@v9
with:
add: '["afile.txt", "anotherfile.txt"]'
```

(note the single-quotes) or a YAML block sequence:

```yaml
- uses: EndBug/add-and-commit@v9
with:
add: |
- afile.txt
- anotherfile.txt
```

(Note the pipe character making it a multiline string.)

### Automated linting

Do you want to lint your JavaScript files, located in the `src` folder, with ESLint, so that fixable changes are done without your intervention? You can use a workflow like this:
Expand Down