Skip to content

Commit

Permalink
chore: [FX-4328] make gh deployment optional (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaklygin authored Sep 6, 2023
1 parent 9d1e65c commit b8fdfc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-grapes-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'davinci-github-actions': major
---

- make GH Deployment optional in `create-jira-deployment` GH Action. By default this feature is disabled
3 changes: 2 additions & 1 deletion create-jira-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The list of arguments, that are used in GH Action:
| `environment` | string || | Name for the target deployment environment |
| `transient-environment` | string | | true | Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. |
| `auto-inactive` | string | | true | Adds a new inactive status to all prior non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. An inactive status is only added to deployments that had a success state. |
| `create-gh-deployment` | string | | false | Creates a Github Deployment along with JIRA Deployment |

### Outputs

Expand All @@ -36,7 +37,7 @@ This is a list of ENV Variables that are used in GH Action:
### Usage

```yaml
- uses: toptal/davinci-github-actions/create-jira-deployment@v9.1.1
- uses: toptal/davinci-github-actions/create-jira-deployment@v10.0.0
with:
token: ${{ env.GITHUB_TOKEN }}
environment: staging
Expand Down
11 changes: 8 additions & 3 deletions create-jira-deployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ inputs:
required: false
description: Adds a new inactive status to all prior non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. An inactive status is only added to deployments that had a success state.
default: 'true'
create-gh-deployment:
required: false
default: 'false'
description: Creates a Github Deployment along with JIRA Deployment


runs:
using: composite
steps:
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: gh-deployment
if: ${{ always() }}
if: ${{ always() && inputs.create-gh-deployment == 'true' }}
with:
token: ${{ inputs.token }}
environment-url: ${{ inputs.environment-url }}
Expand All @@ -41,7 +46,7 @@ runs:
auto-inactive: ${{ inputs.auto-inactive }}

- name: Update deployment status on success
if: ${{ success() }}
if: ${{ success() && inputs.create-gh-deployment == 'true' }}
uses: chrnorm/deployment-status@v2
with:
token: ${{ inputs.token }}
Expand All @@ -51,7 +56,7 @@ runs:
state: 'success'

- name: Update deployment status on failure
if: ${{ failure() }}
if: ${{ failure() && inputs.create-gh-deployment == 'true' }}
uses: chrnorm/deployment-status@v2
with:
token: ${{ inputs.token }}
Expand Down

0 comments on commit b8fdfc9

Please sign in to comment.