Repository: andrew-hossack/dash-tools (language: python)

Issue:
[BUG] Docs Templates page doesn't render correctly 
https://dash-tools.readthedocs.io/en/latest/commands/templates/index.html doesn't render markdown like it should 
:lock: use non-root user in generated Dockerfile
This PR updates `_write_dockerfile()` to create a Dockerfile which creates and uses a non-root user (`dash`). Additionally, I've added some testing for `dockerUtils.py`. 

Resolves #71 .


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml
new file mode 100644
index 0000000..81fc270
--- /dev/null
+++ b/.github/workflows/create_release.yml
@@ -0,0 +1,31 @@
+name: Create new Tag and Release
+on: 
+  push:
+    branches: [main]
+
+jobs:
+  build:
+    name: Create Tag & Release
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - run: |
+          echo DASHTOOLS_VERSION=$(awk -F'=' '/^__version__/ {gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2}' src/dashtools/version.py | sed "s/'//g") >> $GITHUB_ENV
+      - name: Push new tag
+        id: tag_version
+        uses: mathieudutour/github-tag-action@v6.1
+        with:
+          custom_tag: v${{ env.DASHTOOLS_VERSION }}
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+      - name: Create Release
+        id: create_release
+        uses: actions/create-release@latest
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
+        with:
+          tag_name: v${{ env.DASHTOOLS_VERSION }}
+          release_name: Release ${{ github.ref }}
+          run: echo CHANGELOG_VERSION="$(./docs/source/print_version.sh)"  >> $GITHUB_ENV
+          body: ${{ env.CHANGELOG_VERSION }}
+          draft: true # Set to false to auto publish
+          prerelease: false
\ No newline at end of file
diff --git a/.github/workflows/upload_to_pypi.yml b/.github/workflows/upload_to_pypi.yml
index 1cc4f2b..24ae10b 100644
--- a/.github/workflows/upload_to_pypi.yml
+++ b/.github/workflows/upload_to_pypi.yml
@@ -6,8 +6,8 @@ on:
   workflow_dispatch:
 
 jobs:
-  build-test-n-publish:
-    name: Build test and publish Python distributions to PyPI on release
+ upload-pypi-on-release:
+    name: Upload to PyPi on release
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@master
diff --git a/docs/source/changelog.md b/docs/source/changelog.md
index 6e61e61..198d036 100644
--- a/docs/source/changelog.md
+++ b/docs/source/changelog.md
@@ -2,6 +2,13 @@
 
 All notable changes to this project will be documented in this file.
 
+## [1.10.6] - 2022-12-16
+
+### Modified
+
+- Updated naming on github workflows
+- Added a create tag and release action on push to main. Takes current version and latest stuff from the changelog in the release. Currently set to NOT RELEASE AUTOMATICALLY.
+
 ## [1.10.5] - 2022-12-16
 
 ### Fixed
@@ -159,9 +166,8 @@ All notable changes to this project will be documented in this file.
 
 ## [1.4] - 2022-05-22
 
-**dash-tools command is now dashtools via command line**
-
-Major changes are an overhaul to the CLI entry to use subcommands. This looks like a change from this: `dashtools --init MyApp tabs` to `dashtools init MyApp tabs`. Also added a few new commands.
+- **dash-tools command is now dashtools via command line**
+- Major changes are an overhaul to the CLI entry to use subcommands. This looks like a change from this: `dashtools --init MyApp tabs` to `dashtools init MyApp tabs`. Also added a few new commands.
 
 ### Added / Changed
 
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 406d68b..294f47f 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,6 +1,6 @@
 # -- Project information
 
-__version__ = '1.10.5'
+__version__ = '1.10.6'
 
 project = 'DashTools'
 author = 'Andrew Hossack'
diff --git a/docs/source/print_version.sh b/docs/source/print_version.sh
new file mode 100755
index 0000000..a52fd0b
--- /dev/null
+++ b/docs/source/print_version.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Print the latest version notes from chagelog.md
+
+# Store the filepath in a variable
+filepath="docs/source/changelog.md"
+
+# Read the contents of the file into a variable
+contents=$(<"$filepath")
+
+# Set a flag to track whether we are inside the desired block of text
+in_block=false
+count=0
+# Loop through each line in the file
+while read -r line; do
+  # Check if the line starts with a "#" character
+  if [[ $line =~ ^# ]]; then
+    # Set the flag to indicate that we are inside the block
+    in_block=true
+  fi
+
+  # Check if the line contains the "##" pattern
+  if [[ $line =~ "##" ]]; then
+    # If we are inside the block, set the flag to indicate that we are no longer inside the block
+    if $in_block; then
+    #   in_block=false
+      count=$((count + 1))
+    fi
+  fi
+
+  if [ $count -ge 3 ]; then
+    # Break
+    break
+  fi
+
+#   # If we are inside the block, print the line
+#   if $in_block; then
+  echo "$line"
+#   fi
+done <<< "$contents"
diff --git a/src/dashtools/version.py b/src/dashtools/version.py
index f064c75..f3b82e9 100644
--- a/src/dashtools/version.py
+++ b/src/dashtools/version.py
@@ -1,3 +1,3 @@
 # Version in this file must match version for docs/source/version.py!
 
-__version__ = '1.10.5'
+__version__ = '1.10.6'


Test patch:
diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
index 78d426a..97a1758 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -1,13 +1,13 @@
 name: Build and Test on Push or PR
 on: 
-  push:
-    branches: [main, dev]
   pull_request:
     branches: [main, dev]
+  push:
+    branches: [dev]
 
 jobs:
-  build-test-n-publish:
-    name: Build and test Python distributions on push
+  test:
+    name: Build and Test
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@master