Skip to content

Commit

Permalink
add check for if there are even changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 24, 2024
1 parent ee26404 commit 23bea26
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions .github/workflows/copy-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +79,26 @@ jobs:
- name: Copy files
run: cp -r source/${{ inputs.source_dir }}/* destination/${{ inputs.destination_dir }}

- name: Commit changes
- name: Stage destintation changes

run: |
cd destination
git config --global user.name "zeta-icons-bot"
git config --global user.email "[email protected]"
git add -A
- name: Check if there are changes
id: changed
run: |
cd destination
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.changed.outputs.changed == 'true'
run: |
git commit -m "deps(automated): ${{inputs.commit_msg}} ${{ steps.date.outputs.date }}"
git push --set-upstream origin ${{inputs.branch}} -f
# - name: Push files if branch exists
# uses: dmnemec/copy_file_to_another_repo_action@main
# if: ${{ steps.check_branch.outputs.branch_exists != 0 }}
# env:
# API_TOKEN_GITHUB: ${{ secrets.PAT }}
# with:
# source_file: ${{ inputs.source_dir }}
# destination_repo: ${{ inputs.repo }}
# destination_folder: ${{ inputs.destination_dir }}
# destination_branch: ${{ inputs.branch }}
# user_email: "[email protected]"
# user_name: "Zeta Tokens Bot"
# commit_message: "deps(automated): ${{inputs.commit_msg}} ${{ steps.date.outputs.date }}"
# - name: Push files if branch does not exist
# uses: dmnemec/copy_file_to_another_repo_action@main
# if: ${{ steps.check_branch.outputs.branch_exists == 0 }}
# env:
# API_TOKEN_GITHUB: ${{ secrets.PAT }}
# with:
# source_file: ${{ inputs.source_dir }}
# destination_repo: ${{ inputs.repo }}
# destination_folder: ${{ inputs.destination_dir }}
# destination_branch_create: ${{ inputs.branch }}
# user_email: "[email protected]"
# user_name: "Zeta Tokens Bot"
# commit_message: "deps(automated): ${{inputs.commit_msg}} ${{ steps.date.outputs.date }}"

- name: Open PR
uses: thecanadianroot/[email protected]
if: ${{ steps.check_pr.outputs.pr_exists == 0 }}
Expand Down

0 comments on commit 23bea26

Please sign in to comment.