File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -32,26 +32,27 @@ jobs:
3232
3333 - name : Commit changes
3434 run : |
35+ #!/usr/bin/env bash
36+
3537 set -euo pipefail
3638 set -x
3739
38- CHANGED=($(git diff --name-only | xargs))
39- echo $CHANGED
40+ mapfile -t CHANGED < <(git diff --name-only | xargs)
4041
41- # TODO: use an array for $ FILES
42+ declare -a FILES
4243 for value in "${CHANGED[@]}"; do
43- FILES="${FILES} -F files[][path]=$value -F files[][contents]=$(base64 -w0 $value)"
44+ FILES+=( -F " files[][path]=$value" -F " files[][contents]=$(base64 -w0 " $value")")
4445 done
4546
4647 gh api graphql \
47- -F githubRepository=$GITHUB_REPOSITORY \
48- -F branchName=$BRANCH \
49- -F expectedHeadOid=$(git rev-parse HEAD) \
48+ -F githubRepository=" $GITHUB_REPOSITORY" \
49+ -F branchName=" $BRANCH" \
50+ -F expectedHeadOid=" $(git rev-parse HEAD)" \
5051 -F commitMessage="chore: update flake.lock" \
5152 -F 'query=@.github/api/createCommitOnBranch.gql' \
52- ${FILES}
53+ " ${FILES[@]}"
5354
54- gh pr create --fill --base main --head $BRANCH
55+ gh pr create --fill --base main --head " $BRANCH"
5556 env :
5657 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5758
You can’t perform that action at this time.
0 commit comments