Skip to content

Commit

Permalink
fix: Handle missing problem list file
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdguy committed May 6, 2024
1 parent ad4953a commit d789641
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,25 @@ jobs:
echo "unstyled-files=$(cat /tmp/style-problems.txt)" >> $GITHUB_OUTPUT
shell: bash

# TODO: Re-enable after styler unicode issues are fixed
#- name: Autocommit styled files ↗️
# id: autocommit-styled-files
# if: >
# inputs.auto-update
# && steps.check_files.outputs.files_exists == 'true'
# run: |
# git config --global user.name 'github-actions'
# git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
# git config pull.rebase false
# git pull origin ${{ steps.branch-name.outputs.head_ref_branch }} || true
# git add ${{ steps.problem-files.outputs.unstyled-files }}
# git commit -m '[skip style] [skip vbump] Restyle files'
# git push -v origin HEAD:${{ steps.branch-name.outputs.head_ref_branch }} || \
# echo "⚠️ Could not push to ${BRANCH_NAME} on $(git remote -v show -n origin | grep Push)"
# shell: bash
# working-directory: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
# continue-on-error: true
- name: Autocommit styled files ↗️
id: autocommit-styled-files
if: false
# TODO: Re-enable after styler unicode issues are fixed
#if: >
# inputs.auto-update
# && steps.check_files.outputs.files_exists == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config pull.rebase false
git pull origin ${{ steps.branch-name.outputs.head_ref_branch }} || true
git add ${{ steps.problem-files.outputs.unstyled-files }}
git commit -m '[skip style] [skip vbump] Restyle files'
git push -v origin HEAD:${{ steps.branch-name.outputs.head_ref_branch }} || \
echo "⚠️ Could not push to ${BRANCH_NAME} on $(git remote -v show -n origin | grep Push)"
shell: bash
working-directory: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
continue-on-error: true

- name: Styler check summary 🅾
if: >
Expand All @@ -187,12 +188,14 @@ jobs:
"or simply run the following commands",
"for an immediate fix:\n"
))
cat("────────────────────────────────────────\n")
cat(paste0(
"styler::style_file(",
readLines("/tmp/style-problems.R", warn=FALSE),
")\n"
))
cat("────────────────────────────────────────\n")
if (file.exists("/tmp/style-problems.R")) {
cat("────────────────────────────────────────\n")
cat(paste0(
"styler::style_file(",
readLines("/tmp/style-problems.R", warn=FALSE),
")\n"
))
cat("────────────────────────────────────────\n")
}
quit(status = 1)
shell: Rscript {0}

0 comments on commit d789641

Please sign in to comment.