mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Switched to printf
to echo GitHub context
- printf is a little safer and should prevent issues with command execution within the metadata job
This commit is contained in:
parent
869eb04eed
commit
f7aeb4138e
1 changed files with 1 additions and 1 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -43,7 +43,7 @@ jobs:
|
|||
- name: Get metadata (push)
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
NUMBER_OF_COMMITS=$(echo '${{ env.GITHUB_CONTEXT }}' | jq '.event.commits | length')
|
||||
NUMBER_OF_COMMITS=$(printf "%s\n" '${{ toJson(github.event.commits.*.id) }}' | jq length)
|
||||
echo "There are $NUMBER_OF_COMMITS commits in this push."
|
||||
echo "BASE_COMMIT=$(git rev-parse HEAD~$NUMBER_OF_COMMITS)" >> $GITHUB_ENV
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue