Skip to content

Commit

Permalink
Change to using main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rux616 committed Mar 3, 2024
1 parent b5dc967 commit a437252
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/detect_changed_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ printf 'Initializing git\n'
# add a remote for the upstream
git remote add upstream "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"

# fetch upstream/master branch for diffs
git fetch -q --no-tags --prune --depth=1 upstream +refs/heads/master:refs/remotes/upstream/master
# fetch upstream/main branch for diffs
git fetch -q --no-tags --prune --depth=1 upstream +refs/heads/main:refs/remotes/upstream/main


printf 'Analyzing changes\n'
# get a list of all the changed json files
readarray -d '' changed_files < <(git diff --name-only -z upstream/master -- ./**/*.json)
readarray -d '' changed_files < <(git diff --name-only -z upstream/main -- ./**/*.json)

# make a decision
if [[ ${#changed_files[@]} -gt 0 ]]; then
Expand Down
10 changes: 5 additions & 5 deletions .github/scripts/json_diff_pr_comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ printf 'Initializing git\n'
# add a remote for the upstream
git remote add upstream "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"

# fetch upstream/master branch for diffs
git fetch -q --no-tags --prune --depth=1 upstream +refs/heads/master:refs/remotes/upstream/master
# fetch upstream/main branch for diffs
git fetch -q --no-tags --prune --depth=1 upstream +refs/heads/main:refs/remotes/upstream/main

# `git diff` ignores untracked files, so make a dummy commit with all json files as a workaround
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
Expand All @@ -32,10 +32,10 @@ git commit --allow-empty -qm 'dummy commit message'

printf 'Analyzing changes\n'
# get a list of all the changed json files
readarray -d '' changed_files < <(git diff --name-only -z upstream/master -- ./**/*.json)
readarray -d '' changed_files < <(git diff --name-only -z upstream/main -- ./**/*.json)

# get a summary of changes
summary="$(git diff --compact-summary upstream/master -- ./**/*.json)"
summary="$(git diff --compact-summary upstream/main -- ./**/*.json)"

# initialize the body of the comment with some boilerplate text
# shellcheck disable=SC2016 # intentional
Expand All @@ -49,7 +49,7 @@ fi
# go through each file and add its diff to the body
for file in "${changed_files[@]}"; do
# shellcheck disable=SC2016 # intentional
body+="$(printf '\n<details>\n<summary>%s</summary>\n\n```diff\n%s\n```\n</details>\n' "${file}" "$(git diff upstream/master -- "${file}")")"
body+="$(printf '\n<details>\n<summary>%s</summary>\n\n```diff\n%s\n```\n</details>\n' "${file}" "$(git diff upstream/main -- "${file}")")"
done


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Acceptance Tests
on:
pull_request_target:
branches:
- master
- main

jobs:
jsonnet_syntax:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main

jobs:
renderjson:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you'd like to contribute to this project, please check the [Contributing](#co
Copy and paste the following URL into your browser window and Karabiner-Elements *should* ask to install the file:

```none
karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/rux616/karabiner-windows-mode/master/json/windows_shortcuts.json
karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/rux616/karabiner-windows-mode/main/json/windows_shortcuts.json
```

([TOC](#table-of-contents))
Expand Down Expand Up @@ -205,7 +205,7 @@ Pull requests (PRs) and issues are welcome! But first, some notes:
- Remember to give yourself credit in [Credits](#credits) section
- Don't change any `*.json` files! They are automatically rendered and your changes will be overridden.

Again, please refrain from making changes directly to any `*.json` files (all JSON files will be rendered automatically as necessary on a push to the master branch) and instead make your additions in the `*.jsonnet` and `*.libsonnet` files and submit a PR. A comment will automatically be added to the PR showing any JSON changes that will result.
Again, please refrain from making changes directly to any `*.json` files (all JSON files will be rendered automatically as necessary on a push to the main branch) and instead make your additions in the `*.jsonnet` and `*.libsonnet` files and submit a PR. A comment will automatically be added to the PR showing any JSON changes that will result.

([TOC](#table-of-contents))

Expand Down

0 comments on commit a437252

Please sign in to comment.