Skip to content

Commit

Permalink
fix: disable gh env handling by default
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Mar 28, 2024
1 parent 45e6ba1 commit e5de2a6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/use-ks-gh-with-env-preproduction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
pat: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
environment-scope: preproduction
github-env-enabled: true

- uses: socialgouv/kontinuous/.github/actions/deploy-via-github@v1
id: deployment
Expand All @@ -56,6 +57,7 @@ jobs:
deployment-name: ${{ steps.deployment-starting.outputs.deployment-name }}
deployment-ok: ${{ steps.deployment.outcome == 'success' && 'true' || 'false' }}
provider: ${{ steps.deployment.outputs.provider }}
github-env-enabled: true

trivy:
name: 🕵️ Trivy vulnerability scanner
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/use-ks-gh-with-env-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
pat: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
environment-scope: production
github-env-enabled: true

- uses: socialgouv/kontinuous/.github/actions/deploy-via-github@v1
id: deployment
Expand All @@ -55,6 +56,7 @@ jobs:
deployment-name: ${{ steps.deployment-starting.outputs.deployment-name }}
deployment-ok: ${{ steps.deployment.outcome == 'success' && 'true' || 'false' }}
provider: ${{ steps.deployment.outputs.provider }}
github-env-enabled: true

trivy:
name: 🕵️ Trivy vulnerability scanner
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/use-ks-gh-with-env-review-auto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
pat: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
environment-scope: review
github-env-enabled: true

- uses: socialgouv/kontinuous/.github/actions/deploy-via-github@v1
id: deployment
Expand All @@ -55,6 +56,7 @@ jobs:
deployment-name: ${{ steps.deployment-starting.outputs.deployment-name }}
deployment-ok: ${{ steps.deployment.outcome == 'success' && 'true' || 'false' }}
provider: ${{ steps.deployment.outputs.provider }}
github-env-enabled: true

trivy:
name: 🕵️ Trivy vulnerability scanner
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/use-ks-gh-with-env-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
pat: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
environment-scope: review
github-env-enabled: true

- uses: socialgouv/kontinuous/.github/actions/deploy-via-github@v1
id: deployment
Expand All @@ -55,6 +56,7 @@ jobs:
deployment-name: ${{ steps.deployment-starting.outputs.deployment-name }}
deployment-ok: ${{ steps.deployment.outcome == 'success' && 'true' || 'false' }}
provider: ${{ steps.deployment.outputs.provider }}
github-env-enabled: true

trivy:
name: 🕵️ Trivy vulnerability scanner
Expand Down
5 changes: 4 additions & 1 deletion actions/deployment-ending/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ inputs:
provider:
description: "Plateform provider"
required: false
github-env-enabled:
description: "Enable handling of github env"
required: false

outputs:
url:
Expand Down Expand Up @@ -76,7 +79,7 @@ runs:
- name: Notify deployment end
uses: socialgouv/deployments@v1
if: ${{ inputs.deployment-ok == 'true' }}
if: ${{ inputs.deployment-ok == 'true' && inputs.github-env-enabled }}
with:
step: finish
status: ${{ job.status }}
Expand Down
5 changes: 4 additions & 1 deletion actions/deployment-starting/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
pat:
description: "Alternative authentication token to allow cascade workflow triggering"
required: false
github-env-enabled:
description: "Enable handling of github env"
required: false
outputs:
deployment-id:
description: "Deployment id"
Expand Down Expand Up @@ -60,7 +63,7 @@ runs:
- name: Notify deployment start
uses: socialgouv/deployments@v1
id: deployment
if: github.event_name != 'delete'
if: ${{ github.event_name != 'delete' && inputs.github-env-enabled }}
with:
step: start
token: ${{ inputs.pat || inputs.token }}
Expand Down

0 comments on commit e5de2a6

Please sign in to comment.