Skip to content

Commit

Permalink
fix(#510): 🐛 issue with blank lines within .templatesyncignore (#512)
Browse files Browse the repository at this point in the history
* fix: 🐛

Signed-off-by: Andy Augustin <[email protected]>

* fix(#510): 🐛 .templatesyncignore issue with pathspec git reset

Signed-off-by: Andy Augustin <[email protected]>

* docs: 📝 update some features

Signed-off-by: Andy Augustin <[email protected]>

---------

Signed-off-by: Andy Augustin <[email protected]>
  • Loading branch information
AndreasAugustin committed Mar 28, 2024
1 parent 1b54b0f commit 814f456
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Because of the nice community, several feature requests helped to go on with the

## Features

This action is creating a pull request with the latest changes within the target repo whenever it runs with following exceptions

* there is already an open PR created with the latest changes of the source repository.
* if there are new changes and a PR is already open, a new PR will be created (option to clean up older PRs)
* related new changes are ignored within the `.templatesyncignore` file
* the source repository is fully included within the target repository

```mermaid
flowchart LR
github_source("fa:fa-github <b>GitHub</b> source repository <b>[private|public]</b>")
Expand Down Expand Up @@ -89,7 +96,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
# https://github.com/actions/checkout#usage
# uncomment if you use submodules within the source repository
# uncomment if you use submodules within the repository
# with:
# submodules: true

Expand Down Expand Up @@ -119,14 +126,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate token to read from source repo # see: https://github.com/tibdex/github-app-token
- name: Generate token to read from source repo # see: https://github.com/tibdex/github-app-token
id: generate_token
uses: tibdex/github-app-token@v1
# https://github.com/tibdex/github-app-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Checkout
# https://github.com/actions/checkout#usage
uses: actions/checkout@v4
with:
# submodules: true
Expand Down Expand Up @@ -163,6 +172,7 @@ jobs:
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
# https://github.com/actions/checkout#usage
uses: actions/checkout@v4
with:
# submodules: true
Expand Down
4 changes: 2 additions & 2 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ function handle_templatesyncignore() {
# we are checking the ignore file if it exists or is empty
# -s is true if the file contains whitespaces
if [ -s "${template_sync_ignore_file_path}" ]; then
debug "unstage files from template sync ignore"
git reset --pathspec-from-file="${template_sync_ignore_file_path}"
debug "unstage files from template sync ignore ${template_sync_ignore_file_path}"
< "${template_sync_ignore_file_path}" awk NF | xargs -r git reset --

debug "clean untracked files"
git clean -df
Expand Down

0 comments on commit 814f456

Please sign in to comment.