Skip to content

feat: allow fileUpdater to handle multiple files #27#387

Closed
beingrahull wants to merge 1 commit intoDSACMS:mainfrom
beingrahull:fix-strings-issue-27
Closed

feat: allow fileUpdater to handle multiple files #27#387
beingrahull wants to merge 1 commit intoDSACMS:mainfrom
beingrahull:fix-strings-issue-27

Conversation

@beingrahull
Copy link
Copy Markdown

@beingrahull beingrahull commented Apr 5, 2026

github-actions: Update fileUpdater to support multiple files

Problem

The current fileUpdater implementation only accepts a single file as input.
Users who need to update strings across multiple files (e.g., README.md and
CONTRIBUTING.md) have to run the workflow multiple times, which is
inefficient and creates unnecessary overhead. Fixes #27.

Solution

I modified the workflow and the underlying bash script to handle a
comma-separated list of files.

  • Updated updateStringInRepos.yml and action.yml to accept a list of files.
  • Modified update.sh to use an IFS loop to split the input string.
  • Added a check to ensure each file in the list exists before processing.

Result

The file input now accepts multiple file paths separated by commas. The
action will iterate through the list and apply the string replacement to
every valid file provided.

Test Plan

I verified the changes by running the update.sh script locally with a
mock comma-separated string:

  1. Created two dummy files: test1.txt and test2.txt.
  2. Ran: bash .github/fileUpdater/update.sh "old" "new" "test1.txt,test2.txt".
  3. Confirmed that the string replacement was successful in both files.
  4. Verified that the script handles spaces after commas correctly using xargs.

@beingrahull beingrahull closed this by deleting the head repository Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update strings in multiple files

1 participant