From 552eff98a594685751b934af73a8a0929cb81483 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:12:17 +0200 Subject: [PATCH 01/21] Added dry run parameter --- README.md | 2 ++ action.yml | 4 ++++ entrypoint.sh | 24 ++++++++++++++---------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b9a570c..aeee7ab 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ The following parameters can be used in your custom action configuration. | branch | :white_check_mark: | - | The specific branch you want to merge into. Use ${{ github.head_ref }} if you want to use this with pull requests. | | checkpath | :x: | '.' | The path autopep8 checks | | autoparameters | :x: | ' ' | Parameters to use with autopep8 | +| dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. | + ### Example diff --git a/action.yml b/action.yml index f45f6dc..2e82558 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,10 @@ inputs: description: Parameters for autopep8 required: false default: '' + dry: + description: Should this script apply autopep8 directly or just warn? + required: false + default: false runs: using: 'docker' diff --git a/entrypoint.sh b/entrypoint.sh index 4555503..05a1f65 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,16 +32,20 @@ autopep8 -i -r $INPUT_CHECKPATH $INPUT_AUTOPARAMETERS || echo "Problem running a if ! git diff --quiet then - echo "Commiting and pushing changes." - # Calling method to configure the git environemnt - git_setup - # Switch to the actual branch - git checkout $INPUT_BRANCH - - git add "${INPUT_FILE_PATTERN}" - - git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} - git push --set-upstream origin "HEAD:$INPUT_BRANCH" + if $INPUT_DRY; then + echo "Found non-compliant files!" + exit 1 + else + # Calling method to configure the git environemnt + _git_setup + echo "Commiting and pushing changes..." + # Add changes to git + git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}" + # Commit and push changes back + git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} + git push origin + echo "Changes pushed successfully." + fi else echo "Nothing to commit. Exiting." fi From 8fa1e16ff1874828057e044a1037066c69b174eb Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:13:24 +0200 Subject: [PATCH 02/21] Removed branch parameter --- README.md | 1 - action.yml | 11 ----------- entrypoint.sh | 29 ++++++++++++++++++----------- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index aeee7ab..0937743 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ The following parameters can be used in your custom action configuration. | commit_options | :x: | - | Custom git commit options| | file_pattern | :x: | '*' | Custom file pattern for `git add`| | dependencies | :x: | 'requirements.txt' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.| -| branch | :white_check_mark: | - | The specific branch you want to merge into. Use ${{ github.head_ref }} if you want to use this with pull requests. | | checkpath | :x: | '.' | The path autopep8 checks | | autoparameters | :x: | ' ' | Parameters to use with autopep8 | | dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. | diff --git a/action.yml b/action.yml index 2e82558..d6056aa 100644 --- a/action.yml +++ b/action.yml @@ -19,9 +19,6 @@ inputs: description: Path for the repositories 'requirements.txt'. If you have none, you may skip this. required: false default: 'requirements.txt' - branch: - description: Branch which the changes are merged to - required: true checkpath: description: Path autopep8 checks required: false @@ -38,14 +35,6 @@ inputs: runs: using: 'docker' image: 'Dockerfile' - args: - - ${{ inputs.commit_message }} - - ${{ inputs.commit_options }} - - ${{ inputs.file_pattern }} - - ${{ inputs.dependencies }} - - ${{ inputs.branch }} - - ${{ inputs.checkpath }} - - ${{ inputs.autoparameters }} branding: icon: 'fast-forward' diff --git a/entrypoint.sh b/entrypoint.sh index 05a1f65..b5eb4c3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,21 +1,28 @@ #!/bin/sh -l - +# e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set +# x would be for showing the commands before they are executed set -eu +# FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) -git_setup ( ) { - cat <<- EOF > $HOME/.netrc - machine github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN - machine api.github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN +_git_setup ( ) { + cat <<- EOF > $HOME/.netrc + machine github.com + login $GITHUB_ACTOR + password $GITHUB_TOKEN + machine api.github.com + login $GITHUB_ACTOR + password $GITHUB_TOKEN EOF chmod 600 $HOME/.netrc git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" + git config --global user.name "GitHub Action" +} + +# Checks if any files are changed +_git_changed() { + [[ -n "$(git status -s)" ]] } echo "Installing dependencies..." @@ -30,7 +37,7 @@ pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found." echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_AUTOPARAMETERS || echo "Problem running autopep8!" -if ! git diff --quiet +if _git_changed; then if $INPUT_DRY; then echo "Found non-compliant files!" From 90bfa73dca36e92a4e62ac8eb38b1daebe4fce01 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:14:06 +0200 Subject: [PATCH 03/21] Renamed autoparameters to options --- README.md | 2 +- action.yml | 4 ++-- entrypoint.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0937743..633266a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The following parameters can be used in your custom action configuration. | file_pattern | :x: | '*' | Custom file pattern for `git add`| | dependencies | :x: | 'requirements.txt' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.| | checkpath | :x: | '.' | The path autopep8 checks | -| autoparameters | :x: | ' ' | Parameters to use with autopep8 | +| options | :x: | ' ' | Parameters to use with autopep8 | | dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. | diff --git a/action.yml b/action.yml index d6056aa..e3e4cca 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: description: Commit options required: false file_pattern: - description: File pattern used for "git add" + description: File pattern used for `git add` required: false default: '*' dependencies: @@ -23,7 +23,7 @@ inputs: description: Path autopep8 checks required: false default: '.' - autoparameters: + options: description: Parameters for autopep8 required: false default: '' diff --git a/entrypoint.sh b/entrypoint.sh index b5eb4c3..3723aa6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,7 +35,7 @@ pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found." # Apply PEP 8 echo "Running autopep8..." -autopep8 -i -r $INPUT_CHECKPATH $INPUT_AUTOPARAMETERS || echo "Problem running autopep8!" +autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" if _git_changed; then From 2a43a06c54446fc25f85cbb4ac1e9bf84ba37abc Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:14:42 +0200 Subject: [PATCH 04/21] Minor Cleanup --- README.md | 19 +++++++++++-------- action.yml | 4 ++-- entrypoint.sh | 3 +-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 633266a..2e822b9 100644 --- a/README.md +++ b/README.md @@ -21,23 +21,26 @@ The following parameters can be used in your custom action configuration. This is a simple usage example of this script: -``` -name: Autopep 8 +```yaml +# This action works with pull requests and pushes +name: Continuous Integration -on: [pull_request] +on: + pull_request: + push: + branches: + - master jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: - fetch-depth: 1 + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} - uses: creyD/action_autopep8@master - with: - dependencies: 'requirements.txt' - branch: ${{ github.head_ref }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/action.yml b/action.yml index e3e4cca..672985e 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: 'Autopep8 Action' -description: 'Automatically runs the autopep8 command against any commit/ pull request created.' +name: Autopep8 Action +description: Automatically runs the autopep8 command on all your changes. author: Conrad Großer diff --git a/entrypoint.sh b/entrypoint.sh index 3723aa6..074e8ad 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,9 +25,8 @@ _git_changed() { [[ -n "$(git status -s)" ]] } -echo "Installing dependencies..." +echo "Installing autopep8..." pip install -q --upgrade pip -# Install dependencies pip install -q autopep8 # Install custom project dependencies if applicable From 6271ffc1c4a434ed17dedd5fa33381a8acec3ccf Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:15:04 +0200 Subject: [PATCH 05/21] Removed dependencies parameter --- README.md | 1 - action.yml | 4 ---- entrypoint.sh | 4 ---- 3 files changed, 9 deletions(-) diff --git a/README.md b/README.md index 2e822b9..7073d42 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ The following parameters can be used in your custom action configuration. | commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message| | commit_options | :x: | - | Custom git commit options| | file_pattern | :x: | '*' | Custom file pattern for `git add`| -| dependencies | :x: | 'requirements.txt' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.| | checkpath | :x: | '.' | The path autopep8 checks | | options | :x: | ' ' | Parameters to use with autopep8 | | dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. | diff --git a/action.yml b/action.yml index 672985e..691e128 100644 --- a/action.yml +++ b/action.yml @@ -15,10 +15,6 @@ inputs: description: File pattern used for `git add` required: false default: '*' - dependencies: - description: Path for the repositories 'requirements.txt'. If you have none, you may skip this. - required: false - default: 'requirements.txt' checkpath: description: Path autopep8 checks required: false diff --git a/entrypoint.sh b/entrypoint.sh index 074e8ad..bb00e5d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,10 +29,6 @@ echo "Installing autopep8..." pip install -q --upgrade pip pip install -q autopep8 -# Install custom project dependencies if applicable -pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found." - -# Apply PEP 8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" From e658219e542168b13081dc2537c62117fb1729d0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:15:41 +0200 Subject: [PATCH 06/21] Updated docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7073d42..17992b3 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ The following parameters can be used in your custom action configuration. | Parameter | Required | Default | Description | | - | - | - | - | -| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message| -| commit_options | :x: | - | Custom git commit options| -| file_pattern | :x: | '*' | Custom file pattern for `git add`| +| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message | +| commit_options | :x: | - | Custom git commit options | +| file_pattern | :x: | '*' | Custom file pattern for `git add` | | checkpath | :x: | '.' | The path autopep8 checks | | options | :x: | ' ' | Parameters to use with autopep8 | | dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. | From ded507f15f3007e2d54b7c341a2fcd14f4f00029 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:25:44 +0200 Subject: [PATCH 07/21] Adjusted function blocks --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index bb00e5d..a0f005b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) -_git_setup ( ) { +_git_setup { cat <<- EOF > $HOME/.netrc machine github.com login $GITHUB_ACTOR @@ -21,7 +21,7 @@ EOF } # Checks if any files are changed -_git_changed() { +_git_changed { [[ -n "$(git status -s)" ]] } From a51a186977b445e8d99cc7ec7c8dda4600651309 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:29:22 +0200 Subject: [PATCH 08/21] Fixed a bug with function names --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a0f005b..ea3ce32 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) -_git_setup { +_git_setup() { cat <<- EOF > $HOME/.netrc machine github.com login $GITHUB_ACTOR @@ -21,7 +21,7 @@ EOF } # Checks if any files are changed -_git_changed { +_git_changed() { [[ -n "$(git status -s)" ]] } From daa4e6b569447d66ac30fd9f61bba012a72aa080 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:33:18 +0200 Subject: [PATCH 09/21] Moved git changed out of the function --- entrypoint.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index ea3ce32..ba317d1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,11 +20,6 @@ EOF git config --global user.name "GitHub Action" } -# Checks if any files are changed -_git_changed() { - [[ -n "$(git status -s)" ]] -} - echo "Installing autopep8..." pip install -q --upgrade pip pip install -q autopep8 @@ -32,7 +27,7 @@ pip install -q autopep8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" -if _git_changed; +if [[ -n "$(git status -s)" ]]; then if $INPUT_DRY; then echo "Found non-compliant files!" From d4eb464ac007fe2d360db4477c115611cc998169 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:37:15 +0200 Subject: [PATCH 10/21] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index ba317d1..01d85a0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,7 @@ pip install -q autopep8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" -if [[ -n "$(git status -s)" ]]; +if -n "$(git status -s)"; then if $INPUT_DRY; then echo "Found non-compliant files!" From faaac4d2155bc195a8ee8a2715d8ecf8b31320e3 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:39:52 +0200 Subject: [PATCH 11/21] Fixed git status call --- entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 01d85a0..7f64c30 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,8 +27,7 @@ pip install -q autopep8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" -if -n "$(git status -s)"; -then +if [-n "$(git status -s)"]; then if $INPUT_DRY; then echo "Found non-compliant files!" exit 1 From 308fd515a83f1332599ca261bdb6643af43b7822 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:42:09 +0200 Subject: [PATCH 12/21] Tried to fix permission problem --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7f64c30..7af3adb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,8 +21,8 @@ EOF } echo "Installing autopep8..." -pip install -q --upgrade pip -pip install -q autopep8 +sudo pip install -q --upgrade pip +sudo pip install -q autopep8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" From fe6126ea98bb2faceb3fe252cbd5a55ca7e14165 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:49:14 +0200 Subject: [PATCH 13/21] Moved install commands to docker file --- Dockerfile | 4 ++++ entrypoint.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4d6b4dd..8d67bd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ FROM python:3 + +RUN pip install --no-cache-dir -q --upgrade pip +RUN pip install --no-cache-dir -q autopep8 + COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 7af3adb..7f64c30 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,8 +21,8 @@ EOF } echo "Installing autopep8..." -sudo pip install -q --upgrade pip -sudo pip install -q autopep8 +pip install -q --upgrade pip +pip install -q autopep8 echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" From 4449ec2f27d0109107f7d57ccc4a798eb9e3a5e3 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 10:52:19 +0200 Subject: [PATCH 14/21] Removed install commands from sh --- entrypoint.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7f64c30..100415f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,13 +20,11 @@ EOF git config --global user.name "GitHub Action" } -echo "Installing autopep8..." -pip install -q --upgrade pip -pip install -q autopep8 - echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" +git status -s + if [-n "$(git status -s)"]; then if $INPUT_DRY; then echo "Found non-compliant files!" From c8d9e2fc74c2a7a3bdb22c6a3c94aacc88ef6574 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 12:30:39 +0200 Subject: [PATCH 15/21] Fixed the git status bug --- entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 100415f..e0feaa6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,12 +20,16 @@ EOF git config --global user.name "GitHub Action" } +# Checks if any files are changed +_git_changed() { + [[ -n "$(git status -s)" ]] +} + echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" -git status -s - -if [-n "$(git status -s)"]; then +if _git_changed; +then if $INPUT_DRY; then echo "Found non-compliant files!" exit 1 From 3f07e64ccbe6d074c8424411d482c4f3a04d0ac0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 12:34:50 +0200 Subject: [PATCH 16/21] Removed -l command from the shebang --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e0feaa6..32626ce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh -l +#!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed set -eu From 5d9e84c500df5cb235421b1ec9b228748a90c932 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 12:40:33 +0200 Subject: [PATCH 17/21] Added debug parameter --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 32626ce..a55a845 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed -set -eu +set -eux # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) From 0982f18fb54a0091647f2d72f50ca9f56e6dbcc9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 12:47:49 +0200 Subject: [PATCH 18/21] Used alpine docker image instead of python --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8d67bd7..301cc72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM python:3 +FROM node:lts-alpine3.9 + +RUN apk update && apk upgrade && apk add --no-cache bash git openssh python py-pip RUN pip install --no-cache-dir -q --upgrade pip RUN pip install --no-cache-dir -q autopep8 From 60ab91e841de3b07e84245694a81967b2f7f8403 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 13:42:02 +0200 Subject: [PATCH 19/21] Switched off explicit mode --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a55a845..32626ce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed -set -eux +set -eu # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) From f515b34fb63d2d2373aef971a0d4ff72310a30ce Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 13:44:57 +0200 Subject: [PATCH 20/21] Removed apk upgrade from the dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 301cc72..d7651c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:lts-alpine3.9 -RUN apk update && apk upgrade && apk add --no-cache bash git openssh python py-pip +RUN apk update && apk add --no-cache bash git openssh python py-pip RUN pip install --no-cache-dir -q --upgrade pip RUN pip install --no-cache-dir -q autopep8 From 6b39f1b2810b74b0893896af4b7c4d0b8d7a0a82 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 13:46:30 +0200 Subject: [PATCH 21/21] Added explicit shebang to bash script --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 32626ce..8946152 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed set -eu