Skip to content

Commit

Permalink
Merge pull request #240 from joakimlinde/fix-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored Aug 21, 2024
2 parents b236287 + 4692dc8 commit 129ff92
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,17 @@ jobs:
uses: ./.github/workflows/dep-suggests-matrix

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/style
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/roxygenize
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- name: Remove config files from previous iteration
run: |
rm -f .github/dep-suggests-matrix.json .github/versions-matrix.json
shell: bash

- id: commit
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/commit
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ runs:
if [ -n "$(git status --porcelain)" ]; then
echo "Changed"
protected=${{ github.ref_protected }}
if [ "${protected}" = "true" ]; then
foreign=${{ github.event.pull_request.head.repo.full_name != github.repository }}
if [ "${foreign}" = "true" ]; then
# https://github.com/krlmlr/actions-sync/issues/44
echo "Can't push to foreign branch"
elif [ "${protected}" = "true" ]; then
current_branch=$(git branch --show-current)
new_branch=gha-commit
new_branch=gha-commit-$(git rev-parse --short HEAD)
git checkout -b ${new_branch}
git add .
git commit -m "chore: Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
Expand All @@ -38,6 +42,7 @@ runs:
fi
gh workflow run rcc -f ref=$(git rev-parse HEAD)
gh pr merge --merge --auto
else
git fetch
if [ -n "${GITHUB_HEAD_REF}" ]; then
Expand All @@ -50,8 +55,9 @@ runs:
git add .
git commit -m "chore: Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
git push -u origin HEAD
# Only set output if changed
echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT
fi
# Only set output if changed
echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT
fi
shell: bash
7 changes: 5 additions & 2 deletions .github/workflows/dep-suggests-matrix/action.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ get_deps <- function() {

if (Sys.getenv("GITHUB_BASE_REF") != "") {
print(Sys.getenv("GITHUB_BASE_REF"))
has_diff <- (system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::") == 0)
system("git fetch origin ${GITHUB_BASE_REF}")
# Use .. to avoid having to fetch the entire history
# https://github.com/krlmlr/actions-sync/issues/45
has_diff <- (system("git diff origin/${GITHUB_BASE_REF}.. | egrep '^[+][^+]' | grep -q ::") == 0)
if (has_diff) {
system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::")
system("git diff origin/${GITHUB_BASE_REF}.. | egrep '^[+][^+]' | grep -q ::")
packages <- get_deps()
} else {
writeLines("No changes using :: found, not checking without suggested packages")
Expand Down
2 changes: 1 addition & 1 deletion R/as_duckplyr_tibble.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' `as_duckplyr_tibble()` converts the input to a tibble and then to a duckplyr data frame.
#'
#' @return For `as_duckplyr_df()`, an object of class
#' @return For `as_duckplyr_tibble()`, an object of class
#' `c("duckplyr_df", class(tibble()))` .
#'
#' @rdname as_duckplyr_df
Expand Down

0 comments on commit 129ff92

Please sign in to comment.