Skip to content

Commit

Permalink
ci: fix patch application
Browse files Browse the repository at this point in the history
  • Loading branch information
gotmax23 committed Dec 2, 2023
1 parent 0ef8eb4 commit 3ae8d59
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/commit-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,22 @@ jobs:
env:
major_version: "${{ inputs.major-version }}"
version: "${{ inputs.version }}"
id: create-patch
run: |
mkdir -p build/patches
touch build/patches/.keep
git diff || :
git add "data/${major_version}"
if git diff-index --quiet HEAD ${{ inputs.changed-files }}; then
echo "changed=false" >> "${GITHUB_OUTPUT}"
else
echo "changed=true" >> "${GITHUB_OUTPUT}"
echo "Nothing to do"
exit
fi
git commit -m "data: update ${version}"
git format-patch -1 -o build/patches
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-patches
path: "build/patches"
path: "test_results/build/patches/"
commit:
name: Commit and push data
runs-on: ubunut-latest
Expand All @@ -110,8 +109,8 @@ jobs:
path: build/patches
- name: Apply patches
run: |
if [ -n "$(find build/patches -type f)" ]; then
git am --committer-date-is-author-date build/patches/*
if [ -n "$(find build/patches -type f -name '*.patch')" ]; then
git am --committer-date-is-author-date build/patches/*.patch
git push
fi

0 comments on commit 3ae8d59

Please sign in to comment.