From ae74fd9f485e1059924436e3d57c332ac729eae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20A=2E=20Sch=C3=BCnemann?= <44511825+LuisHenri@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:06:20 -0300 Subject: [PATCH 01/12] feat: let .templatesyncignore and .templatesyncversion be inside .github MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Henrique A. Schünemann <44511825+LuisHenri@users.noreply.github.com> --- src/sync_template.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index a0a16b3..7f357e9 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -36,14 +36,16 @@ NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" echo "::group::Check new changes" echo "::debug::new Git HASH ${NEW_TEMPLATE_GIT_HASH}" -if [ -r ${TEMPLATE_VERSION_FILE_NAME} ] -then + +if [[ -f ".github/$TEMPLATE_VERSION_FILE_NAME" ]]; then + TEMPLATE_VERSION_FILE_NAME=".github/$TEMPLATE_VERSION_FILE_NAME" +fi +if [ -r ${TEMPLATE_VERSION_FILE_NAME} ]; then CURRENT_TEMPLATE_GIT_HASH=$(cat ${TEMPLATE_VERSION_FILE_NAME}) echo "::debug::Current git hash ${CURRENT_TEMPLATE_GIT_HASH}" fi -if [ "${NEW_TEMPLATE_GIT_HASH}" == "${CURRENT_TEMPLATE_GIT_HASH}" ] -then +if [ "${NEW_TEMPLATE_GIT_HASH}" == "${CURRENT_TEMPLATE_GIT_HASH}" ]; then echo "::warn::repository is up to date" exit 0 fi @@ -65,10 +67,12 @@ echo "::endgroup::" echo "::group::commit and push changes" git add . +if [[ -f ".github/$TEMPLATE_SYNC_IGNORE_FILE_NAME" ]]; then + TEMPLATE_SYNC_IGNORE_FILE_NAME=".github/$TEMPLATE_SYNC_IGNORE_FILE_NAME" +fi # 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_NAME} ] -then +if [ -s ${TEMPLATE_SYNC_IGNORE_FILE_NAME} ]; then echo "::debug::unstage files from template sync ignore" git reset --pathspec-from-file="${TEMPLATE_SYNC_IGNORE_FILE_NAME}" From d117c7f418114fc8b0a2fdaad3830c20fcb949de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Wed, 14 Dec 2022 00:03:50 -0300 Subject: [PATCH 02/12] refactor(sync-template): use .templateversionrc from root if found Otherwise, if it is not present or inside .github, use it as if inside .github --- src/sync_template.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index 7f357e9..a0d8bf5 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -37,7 +37,10 @@ NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" echo "::group::Check new changes" echo "::debug::new Git HASH ${NEW_TEMPLATE_GIT_HASH}" -if [[ -f ".github/$TEMPLATE_VERSION_FILE_NAME" ]]; then +if [[ -f "$TEMPLATE_VERSION_FILE_NAME" ]]; then + echo "::debug::version file is located in root folder" +else + echo "::debug::version file is located either in .github folder or not present" TEMPLATE_VERSION_FILE_NAME=".github/$TEMPLATE_VERSION_FILE_NAME" fi if [ -r ${TEMPLATE_VERSION_FILE_NAME} ]; then From 38108c6ef7e91ac2a7de85787a62f2be447ff92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Wed, 14 Dec 2022 00:06:52 -0300 Subject: [PATCH 03/12] docs(readme): add docs regarding .templatesyncignore being inside .github folder --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 84302ff..d741fed 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ jobs: Create a `.templatesyncignore` file. Just like writing a `.gitignore` file, follow the [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)) in defining the files and folders that should be excluded from syncing with the template repository. +It can also be stored inside `.github` folder. + ## Debug You must create a secret named `ACTIONS_STEP_DEBUG` with the value `true` to see the debug messages set by this command in the log. For more information, see "[Enabling debug logging.][enabling-debug-logging]" From 24550349eca9e1ab25815f918d31556509938bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Wed, 14 Dec 2022 22:24:36 -0300 Subject: [PATCH 04/12] refactor(sync-template): rename variables from FILE_NAME to FILE_PATH --- src/sync_template.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index a0d8bf5..d22af51 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -28,8 +28,8 @@ if [[ -n "${SRC_SSH_PRIVATEKEY_ABS_PATH}" ]]; then export GIT_SSH_COMMAND="ssh -i ${SRC_SSH_PRIVATEKEY_ABS_PATH}" fi -TEMPLATE_VERSION_FILE_NAME=".templateversionrc" -TEMPLATE_SYNC_IGNORE_FILE_NAME=".templatesyncignore" +TEMPLATE_VERSION_FILE_PATH=".templateversionrc" +TEMPLATE_SYNC_IGNORE_FILE_PATH=".templatesyncignore" TEMPLATE_REMOTE_GIT_HASH=$(git ls-remote "${SOURCE_REPO}" HEAD | awk '{print $1}') NEW_TEMPLATE_GIT_HASH=$(git rev-parse --short "${TEMPLATE_REMOTE_GIT_HASH}") NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" @@ -37,14 +37,16 @@ NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" echo "::group::Check new changes" echo "::debug::new Git HASH ${NEW_TEMPLATE_GIT_HASH}" -if [[ -f "$TEMPLATE_VERSION_FILE_NAME" ]]; then +# Check if the Version File exists inside root of the repository +if [[ -f "$TEMPLATE_VERSION_FILE_PATH" ]]; then echo "::debug::version file is located in root folder" else + # Else use it as if it is located in the .github folder echo "::debug::version file is located either in .github folder or not present" - TEMPLATE_VERSION_FILE_NAME=".github/$TEMPLATE_VERSION_FILE_NAME" + TEMPLATE_VERSION_FILE_PATH=".github/$TEMPLATE_VERSION_FILE_PATH" fi -if [ -r ${TEMPLATE_VERSION_FILE_NAME} ]; then - CURRENT_TEMPLATE_GIT_HASH=$(cat ${TEMPLATE_VERSION_FILE_NAME}) +if [ -r ${TEMPLATE_VERSION_FILE_PATH} ]; then + CURRENT_TEMPLATE_GIT_HASH=$(cat ${TEMPLATE_VERSION_FILE_PATH}) echo "::debug::Current git hash ${CURRENT_TEMPLATE_GIT_HASH}" fi @@ -63,21 +65,22 @@ echo "::endgroup::" echo "::group::persist template version" echo "write new template version file" -echo "${NEW_TEMPLATE_GIT_HASH}" > ${TEMPLATE_VERSION_FILE_NAME} -echo "::debug::wrote new template version file with content $(cat ${TEMPLATE_VERSION_FILE_NAME})" +echo "${NEW_TEMPLATE_GIT_HASH}" > ${TEMPLATE_VERSION_FILE_PATH} +echo "::debug::wrote new template version file with content $(cat ${TEMPLATE_VERSION_FILE_PATH})" echo "::endgroup::" echo "::group::commit and push changes" git add . -if [[ -f ".github/$TEMPLATE_SYNC_IGNORE_FILE_NAME" ]]; then - TEMPLATE_SYNC_IGNORE_FILE_NAME=".github/$TEMPLATE_SYNC_IGNORE_FILE_NAME" +# +if [[ -f ".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" ]]; then + TEMPLATE_SYNC_IGNORE_FILE_PATH=".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" fi # 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_NAME} ]; then +if [ -s ${TEMPLATE_SYNC_IGNORE_FILE_PATH} ]; then echo "::debug::unstage files from template sync ignore" - git reset --pathspec-from-file="${TEMPLATE_SYNC_IGNORE_FILE_NAME}" + git reset --pathspec-from-file="${TEMPLATE_SYNC_IGNORE_FILE_PATH}" echo "::debug::clean untracked files" git clean -df From 586be66108a814baab19af3681a92b18f8572e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Wed, 14 Dec 2022 22:29:02 -0300 Subject: [PATCH 05/12] refactor(sync-template): use IF...ELSE for Ignore file in the same way as Version file --- src/sync_template.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index d22af51..71e84cc 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -72,8 +72,12 @@ echo "::endgroup::" echo "::group::commit and push changes" git add . -# -if [[ -f ".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" ]]; then +# Check if the Ignore File exists inside root of the repository +if [[ -f "$TEMPLATE_SYNC_IGNORE_FILE_PATH" ]]; then + echo "::debug::version file is located in root folder" +else + # Else use it as if it is located in the .github folder + echo "::debug::version file is located either in .github folder or not present" TEMPLATE_SYNC_IGNORE_FILE_PATH=".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" fi # we are checking the ignore file if it exists or is empty From fc43ea97069844b48d1c4fb20114c2f34d032c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Wed, 14 Dec 2022 23:36:06 -0300 Subject: [PATCH 06/12] chore(sync-template): fix typo --- src/sync_template.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index 71e84cc..8b30e7e 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -74,10 +74,10 @@ git add . # Check if the Ignore File exists inside root of the repository if [[ -f "$TEMPLATE_SYNC_IGNORE_FILE_PATH" ]]; then - echo "::debug::version file is located in root folder" + echo "::debug::ignore file is located in root folder" else # Else use it as if it is located in the .github folder - echo "::debug::version file is located either in .github folder or not present" + echo "::debug::ignore file is located either in .github folder or not present" TEMPLATE_SYNC_IGNORE_FILE_PATH=".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" fi # we are checking the ignore file if it exists or is empty From 404a201d7c7c25ea6a672598b5e3aa78c2efc4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sat, 24 Dec 2022 12:09:31 -0300 Subject: [PATCH 07/12] chore(sync-template): use version and ignore files if in .github or doesn't exist at all --- src/sync_template.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/sync_template.sh b/src/sync_template.sh index 8b30e7e..32a3d9b 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -37,13 +37,10 @@ NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" echo "::group::Check new changes" echo "::debug::new Git HASH ${NEW_TEMPLATE_GIT_HASH}" -# Check if the Version File exists inside root of the repository -if [[ -f "$TEMPLATE_VERSION_FILE_PATH" ]]; then - echo "::debug::version file is located in root folder" -else - # Else use it as if it is located in the .github folder - echo "::debug::version file is located either in .github folder or not present" - TEMPLATE_VERSION_FILE_PATH=".github/$TEMPLATE_VERSION_FILE_PATH" +# Check if the Version File exists inside .github folder or if it doesn't exist at all +if [[ -f ".github/${TEMPLATE_VERSION_FILE_PATH}" || ! -f "${TEMPLATE_VERSION_FILE_PATH}" ]]; then + echo "::debug::using version file as in .github folder" + TEMPLATE_VERSION_FILE_PATH=".github/${TEMPLATE_VERSION_FILE_PATH}" fi if [ -r ${TEMPLATE_VERSION_FILE_PATH} ]; then CURRENT_TEMPLATE_GIT_HASH=$(cat ${TEMPLATE_VERSION_FILE_PATH}) @@ -72,13 +69,10 @@ echo "::endgroup::" echo "::group::commit and push changes" git add . -# Check if the Ignore File exists inside root of the repository -if [[ -f "$TEMPLATE_SYNC_IGNORE_FILE_PATH" ]]; then - echo "::debug::ignore file is located in root folder" -else - # Else use it as if it is located in the .github folder - echo "::debug::ignore file is located either in .github folder or not present" - TEMPLATE_SYNC_IGNORE_FILE_PATH=".github/$TEMPLATE_SYNC_IGNORE_FILE_PATH" +# Check if the Ignore File exists inside .github folder or if it doesn't exist at all +if [[ -f ".github/${TEMPLATE_SYNC_IGNORE_FILE_PATH}" || ! -f "${TEMPLATE_SYNC_IGNORE_FILE_PATH}" ]]; then + echo "::debug::using ignore file as in .github folder" + TEMPLATE_SYNC_IGNORE_FILE_PATH=".github/${TEMPLATE_SYNC_IGNORE_FILE_PATH}" fi # we are checking the ignore file if it exists or is empty # -s is true if the file contains whitespaces From 507cc1ec6e3a3b502b92a4a6d275ee7a3024d38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sat, 24 Dec 2022 12:53:03 -0300 Subject: [PATCH 08/12] docs(architecture): add docs regarding version and ignore files being inside .github or root folder --- docs/ARCHITECTURE.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 7db2f18..e43e221 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -25,12 +25,14 @@ GitConfigureEntry[Configure git global settings] EnvCheckSync{required environment variables exists} SshConfigureSync[Configure SSH variables] SetVariablesSync[Set the needed variables, e.q. with reading remote repository] -CheckTemplateFileExists{"Check if the .templatesyncrc file exists in repository"} +CheckTemplateFileExistsGithub{"Check if the .templatesyncrc file exists inside .github folder"} +CheckTemplateFileExistsRoot{"Check if the .templatesyncrc file exists inside root folder"} WriteTemplateVersionSync["Read and write the template sync version into variable"] CompareTemplateVersionSync{"Compare the source repository version"} GitCheckoutSync["create git branch "] GitPullSync["pull from remote repository"] -CheckIgnoreFileExistsSync{"check if .templatesyncignore file exists"} +CheckIgnoreFileExistsSyncGithub{"Check if the .templatesyncignore file exists inside .github folder"} +CheckIgnoreFileExistsSyncRoot{"Check if the .templatesyncignore file exists inside root folder"} ResetChangesSync["Reset the changes listed within the ignore file"] GitCommitSync["commit the changes"] @@ -67,9 +69,11 @@ EnvCheckSync -->|do exist| SshConfigureSync SshConfigureSync --> SetVariablesSync subgraph compareVersion["compare the sync version"] -SetVariablesSync --> CheckTemplateFileExists -CheckTemplateFileExists -->|exists| WriteTemplateVersionSync -CheckTemplateFileExists -->|does not exist|CompareTemplateVersionSync +SetVariablesSync --> CheckTemplateFileExistsGithub +CheckTemplateFileExistsGithub -->|exists| WriteTemplateVersionSync +CheckTemplateFileExistsGithub -->|does not exist|CheckTemplateFileExistsRoot +CheckTemplateFileExistsRoot --> |exists| WriteTemplateVersionSync +CheckTemplateFileExistsRoot --> |does not exist| CompareTemplateVersionSync WriteTemplateVersionSync --> CompareTemplateVersionSync CompareTemplateVersionSync -->|equal versions| Exit end @@ -78,8 +82,10 @@ subgraph git["Git actions"] CompareTemplateVersionSync -->|versions not equal| GitCheckoutSync GitCheckoutSync --> GitPullSync GitPullSync --> CheckIgnoreFileExistsSync -CheckIgnoreFileExistsSync -->|does not exist| GitCommitSync -CheckIgnoreFileExistsSync -->|exists| ResetChangesSync +CheckIgnoreFileExistsSyncGithub -->|exists| ResetChangesSync +CheckIgnoreFileExistsSyncGithub -->|does not exist| CheckIgnoreFileExistsSyncRoot +CheckIgnoreFileExistsSyncRoot -->|exists| ResetChangesSync +CheckIgnoreFileExistsSyncRoot -->|does not exist| GitCommitSync ResetChangesSync --> GitCommitSync end From b54452910cc2bfa930f34c27104e50ee704a6404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sat, 24 Dec 2022 13:00:29 -0300 Subject: [PATCH 09/12] docs(readme): fix conflict --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d741fed..06001c8 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,8 @@ Create a `.templatesyncignore` file. Just like writing a `.gitignore` file, foll It can also be stored inside `.github` folder. +_Note: It is not possible to sync also the `.templatesyncignore` itself. Any changes from the template repository will be restored automatically._ + ## Debug You must create a secret named `ACTIONS_STEP_DEBUG` with the value `true` to see the debug messages set by this command in the log. For more information, see "[Enabling debug logging.][enabling-debug-logging]" From 44c8c604a19de0f11f7adbd1c54575c650b41b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sun, 25 Dec 2022 13:48:32 -0300 Subject: [PATCH 10/12] docs(architecture): simpler diagram --- docs/ARCHITECTURE.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index e43e221..fe719c0 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -25,14 +25,12 @@ GitConfigureEntry[Configure git global settings] EnvCheckSync{required environment variables exists} SshConfigureSync[Configure SSH variables] SetVariablesSync[Set the needed variables, e.q. with reading remote repository] -CheckTemplateFileExistsGithub{"Check if the .templatesyncrc file exists inside .github folder"} -CheckTemplateFileExistsRoot{"Check if the .templatesyncrc file exists inside root folder"} +CheckTemplateFileExists{"Check if the .templatesyncrc file exists\n(First inside .github folder, then in root)"} WriteTemplateVersionSync["Read and write the template sync version into variable"] CompareTemplateVersionSync{"Compare the source repository version"} GitCheckoutSync["create git branch "] GitPullSync["pull from remote repository"] -CheckIgnoreFileExistsSyncGithub{"Check if the .templatesyncignore file exists inside .github folder"} -CheckIgnoreFileExistsSyncRoot{"Check if the .templatesyncignore file exists inside root folder"} +CheckIgnoreFileExistsSync{"Check if .templatesyncignore file exists\n(First inside .github folder, then in root)"} ResetChangesSync["Reset the changes listed within the ignore file"] GitCommitSync["commit the changes"] @@ -69,11 +67,9 @@ EnvCheckSync -->|do exist| SshConfigureSync SshConfigureSync --> SetVariablesSync subgraph compareVersion["compare the sync version"] -SetVariablesSync --> CheckTemplateFileExistsGithub -CheckTemplateFileExistsGithub -->|exists| WriteTemplateVersionSync -CheckTemplateFileExistsGithub -->|does not exist|CheckTemplateFileExistsRoot -CheckTemplateFileExistsRoot --> |exists| WriteTemplateVersionSync -CheckTemplateFileExistsRoot --> |does not exist| CompareTemplateVersionSync +SetVariablesSync --> CheckTemplateFileExists +CheckTemplateFileExists -->|exists| WriteTemplateVersionSync +CheckTemplateFileExists -->|does not exist| CompareTemplateVersionSync WriteTemplateVersionSync --> CompareTemplateVersionSync CompareTemplateVersionSync -->|equal versions| Exit end @@ -82,10 +78,8 @@ subgraph git["Git actions"] CompareTemplateVersionSync -->|versions not equal| GitCheckoutSync GitCheckoutSync --> GitPullSync GitPullSync --> CheckIgnoreFileExistsSync -CheckIgnoreFileExistsSyncGithub -->|exists| ResetChangesSync -CheckIgnoreFileExistsSyncGithub -->|does not exist| CheckIgnoreFileExistsSyncRoot -CheckIgnoreFileExistsSyncRoot -->|exists| ResetChangesSync -CheckIgnoreFileExistsSyncRoot -->|does not exist| GitCommitSync +CheckIgnoreFileExistsSync -->|does not exist| GitCommitSync +CheckIgnoreFileExistsSync -->|exists| ResetChangesSync ResetChangesSync --> GitCommitSync end From 27192b3bf6a62cab634f3e8864926af09827a488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sun, 25 Dec 2022 14:11:30 -0300 Subject: [PATCH 11/12] style(architecture): start sentences with capital letter --- docs/ARCHITECTURE.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index fe719c0..f25c1f2 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -6,7 +6,7 @@ within this section you will find some ## Code -The architecture and logic within the code +The architecture and logic within the code: ```mermaid flowchart TD @@ -17,26 +17,26 @@ GitHubActionEnv{Read GitHubAction env} style Start fill:#f9f,stroke:#333,stroke-width:4px style Exit fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5 -EnvCheckEntry{required environment variables exists} +EnvCheckEntry{Required environment variables exists} SshCheckEntry{SSH private key defined} SshConfigureEntry[Configure ssh related variables] GitConfigureEntry[Configure git global settings] -EnvCheckSync{required environment variables exists} +EnvCheckSync{Required environment variables exists} SshConfigureSync[Configure SSH variables] SetVariablesSync[Set the needed variables, e.q. with reading remote repository] CheckTemplateFileExists{"Check if the .templatesyncrc file exists\n(First inside .github folder, then in root)"} WriteTemplateVersionSync["Read and write the template sync version into variable"] CompareTemplateVersionSync{"Compare the source repository version"} -GitCheckoutSync["create git branch "] -GitPullSync["pull from remote repository"] +GitCheckoutSync["Create git branch "] +GitPullSync["Pull from remote repository"] CheckIgnoreFileExistsSync{"Check if .templatesyncignore file exists\n(First inside .github folder, then in root)"} ResetChangesSync["Reset the changes listed within the ignore file"] -GitCommitSync["commit the changes"] +GitCommitSync["Commit the changes"] -CheckIsDryRun{"check if is_dry_run is set to true"} +CheckIsDryRun{"Check if is_dry_run is set to true"} GitPushSync["Push the changes to GitHub"] -GitPullRequestSync["create a pull request on GitHub"] +GitPullRequestSync["Create a pull request on GitHub"] subgraph githubactions["GitHubActions"] @@ -66,7 +66,7 @@ EnvCheckSync -->|do not exist| Exit EnvCheckSync -->|do exist| SshConfigureSync SshConfigureSync --> SetVariablesSync -subgraph compareVersion["compare the sync version"] +subgraph compareVersion["Compare the sync version"] SetVariablesSync --> CheckTemplateFileExists CheckTemplateFileExists -->|exists| WriteTemplateVersionSync CheckTemplateFileExists -->|does not exist| CompareTemplateVersionSync @@ -74,7 +74,7 @@ WriteTemplateVersionSync --> CompareTemplateVersionSync CompareTemplateVersionSync -->|equal versions| Exit end -subgraph git["Git actions"] +subgraph git["Git Actions"] CompareTemplateVersionSync -->|versions not equal| GitCheckoutSync GitCheckoutSync --> GitPullSync GitPullSync --> CheckIgnoreFileExistsSync @@ -83,7 +83,7 @@ CheckIgnoreFileExistsSync -->|exists| ResetChangesSync ResetChangesSync --> GitCommitSync end -subgraph github["gitHub actions"] +subgraph github["GitHub Actions"] GitCommitSync --> CheckIsDryRun CheckIsDryRun -->|is true| Exit CheckIsDryRun -->|is not true| GitPushSync From b1405449dda176401444169681331ddf6e7abf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Henrique=20Allebrandt=20Sch=C3=BCnemann?= Date: Sun, 25 Dec 2022 14:25:23 -0300 Subject: [PATCH 12/12] =?UTF-8?q?chore(all-contributorsrc):=20fix=20my=20p?= =?UTF-8?q?rofile=20URL=20=F0=9F=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .all-contributorsrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index edd5028..6cf9c51 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -136,7 +136,7 @@ "login": "LuisHenri", "name": "Luís Henrique A. Schünemann", "avatar_url": "https://avatars.githubusercontent.com/u/44511825?v=4", - "profile": "https://www.instagram.com/LuisHenri_", + "profile": "https://github.com/LuisHenri", "contributions": [ "ideas" ]