Skip to content

Commit 05f60b9

Browse files
committed
fixup! ci: custom update-flake with sign commits
1 parent a88bc5c commit 05f60b9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/update-flake-lock.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)