Skip to content

Commit

Permalink
fix: action
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Dec 2, 2024
1 parent 8aa0e38 commit 599f8d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/auto-pr-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
BASE_NAME=$(jq -r '.name' info.json)
FILENAME="${BASE_NAME}.json"
echo "filename=$FILENAME" >> $GITHUB_OUTPUT
echo "branch_name=update-file-$(date +%s)" >> $GITHUB_OUTPUT
cp info.json ../target.json
- name: Checkout target repository
Expand All @@ -37,10 +38,15 @@ jobs:
cd target-repo
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git checkout -b update-file
git checkout -b ${{ steps.get-filename.outputs.branch_name }}
git add infos
git commit -m "Update ${{ steps.get-filename.outputs.filename }}"
git push origin update-file
git diff --exit-code
if [ $? -ne 0 ]; then
git commit -m "Update ${{ steps.get-filename.outputs.filename }}"
git push origin ${{ steps.get-filename.outputs.branch_name }}
else
echo "No changes to commit."
fi
- name: Create Pull Request
env:
Expand Down

0 comments on commit 599f8d8

Please sign in to comment.