From fe72e2764110bbf848556311a7b9199fbf5c50ba Mon Sep 17 00:00:00 2001 From: Barry Date: Mon, 10 Aug 2020 23:55:52 +0100 Subject: [PATCH 1/3] Only run deploy to Docker on original repo and not forks --- .github/workflows/deploy-PROD.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-PROD.yml b/.github/workflows/deploy-PROD.yml index 1a20e1e9..03f20315 100644 --- a/.github/workflows/deploy-PROD.yml +++ b/.github/workflows/deploy-PROD.yml @@ -27,6 +27,8 @@ jobs: name: Deploy Docker Image - PROD # Set the agent to run on runs-on: ubuntu-latest + # Only run this + if: github.repository == 'github/super-linter' ################## # Load all steps # ################## From d03cfd78aa039fc0febf61c770123acb6735728f Mon Sep 17 00:00:00 2001 From: Barry Date: Tue, 11 Aug 2020 00:04:35 +0100 Subject: [PATCH 2/3] Finish sentence --- .github/workflows/deploy-PROD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-PROD.yml b/.github/workflows/deploy-PROD.yml index 03f20315..ad5c77f7 100644 --- a/.github/workflows/deploy-PROD.yml +++ b/.github/workflows/deploy-PROD.yml @@ -27,7 +27,7 @@ jobs: name: Deploy Docker Image - PROD # Set the agent to run on runs-on: ubuntu-latest - # Only run this + # Only run this on the main repo if: github.repository == 'github/super-linter' ################## # Load all steps # From c3953b792cf92fd3e1d3a489b3a3d9aded648491 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 11 Aug 2020 08:09:57 -0500 Subject: [PATCH 3/3] adding better logics --- .github/workflows/automerge-dependabot.yml | 4 +- .github/workflows/deploy-DEV-PR.yml | 72 ---------------------- .github/workflows/deploy-RELEASE.yml | 2 + 3 files changed, 4 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/deploy-DEV-PR.yml diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml index 32eb70a6..e00b6c22 100644 --- a/.github/workflows/automerge-dependabot.yml +++ b/.github/workflows/automerge-dependabot.yml @@ -34,11 +34,11 @@ jobs: id: wait-for-build with: token: ${{ secrets.GITHUB_TOKEN }} - checkName: Deploy Docker Image - DEV + checkName: Deploy Docker Image - DEV ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: merge - if: steps.wait-for-build.outputs.conclusion == 'success' + if: steps.wait-for-build.outputs.conclusion == 'success' || steps.wait-for-build.outputs.conclusion == 'skipped' uses: actions/github-script@v2 with: script: | diff --git a/.github/workflows/deploy-DEV-PR.yml b/.github/workflows/deploy-DEV-PR.yml deleted file mode 100644 index df679021..00000000 --- a/.github/workflows/deploy-DEV-PR.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -######################### -######################### -## Deploy Docker Image ## -######################### -######################### - -# -# Documentation: -# https://help.github.com/en/articles/workflow-syntax-for-github-actions -# - -####################################### -# Start the job on all push to master # -####################################### -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: [master] - pull_request: - branches-ignore: [] - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Deploy Docker Image PR - DEV - # Set the agent to run on - runs-on: ubuntu-latest - # Prevent duplicate run from happening when a forked push is committed - if: github.event.pull_request.head.repo.full_name != github.repository - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v2.3.1 - - ################################### - # Build image locally for testing # - ################################### - - name: Build image - shell: bash - run: docker build --no-cache -t github/super-linter:${GITHUB_SHA} . - - ##################################### - # Run Linter against Test code base # - ##################################### - - name: Run Test Cases - shell: bash - run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=tap -e OUTPUT_FOLDER=${GITHUB_SHA} -e OUTPUT_DETAILS=detailed -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA} - - ######################################### - # Clean code base to run agaisnt it all # - ######################################### - - name: Clean Test code base for additional testing - shell: bash - run: .automation/clean-code-base-for-tests.sh - - ############################################ - # Run Linter against ALL cleaned code base # - ############################################ - - name: Run against all code base - shell: bash - run: docker run -e RUN_LOCAL=true -e OUTPUT_DETAILS=detailed -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA} diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index 616f5cd0..bd1009e0 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -27,6 +27,8 @@ jobs: name: Deploy Docker Image - Release # Set the agent to run on runs-on: ubuntu-latest + # Only run on main repo + if: github.repository == 'github/super-linter' ################## # Load all steps # ##################