diff --git a/.github/workflows/copy-workflow.yml b/.github/workflows/copy-workflow.yml index 5d3e78681..4b217413d 100644 --- a/.github/workflows/copy-workflow.yml +++ b/.github/workflows/copy-workflow.yml @@ -31,7 +31,17 @@ jobs: git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' + - name: Check for changes + id: changes + run: | + if git diff --quiet; then + echo "::set-output name=changes::false" + else + echo "::set-output name=changes::true" + fi + - name: Create and push changes to new branch + if: steps.changes.outputs.changes == 'true' run: | git checkout -b crowdin-copy-changes git add . @@ -39,9 +49,11 @@ jobs: git push --set-upstream origin crowdin-copy-changes - name: Create Pull Request + if: steps.changes.outputs.changes == 'true' uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} branch: crowdin-copy-changes title: "Copy ignored files using crowdin:copy" body: "This PR was created by GitHub Actions to copy ignored files using the crowdin:copy command." + labels: ['automation']