Skip to content

Commit 9862368

Browse files
committed
EN-26617 - Updating action to support multiple entities
1 parent e3266ea commit 9862368

File tree

8 files changed

+9451
-20131
lines changed

8 files changed

+9451
-20131
lines changed

.github/workflows/build-and-review-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ jobs:
6060
# The npm script to run to build the action. This is typically 'npm run build' if the
6161
# action needs to be compiled. For composite-run-steps actions this is typically empty.
6262
build-command: 'npm run build'
63+
node-version: '22'

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This action inactivates GitHub Deployments and Deployment Statuses through [GitH
2323
| `environment` | true | The environment the release was deployed to, i.e. [Dev\|QA\|Stage\|Demo\|UAT\|Prod] |
2424
| `entity` | true | The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db" |
2525
| `instance` | true | A freeform identifier to distinguish separately deployed instances of the entity in the same environment. Typical uses would be to name a slot and/or region, e.g "NA26", "NA26-slot1", "NA27-blue" |
26+
| `entities` | true | JSON array of entity/instance objects to inactivate for an environment. Object has properties of entity, and instance. Example: `[{'entity':'proj-app','instance':'NA26'},{'entity':'proj-infrastructure','instance':'NA26'}]` |
2627

2728
## Usage Example
2829

@@ -55,7 +56,7 @@ permissions:
5556

5657
jobs:
5758
deploy-different-ways:
58-
environment: ${{ github.event.inputs.environment }}
59+
environment: ${{ inputs.environment }}
5960
runs-on: [ubuntu-20.04]
6061

6162
steps:
@@ -68,13 +69,34 @@ jobs:
6869
steps:
6970
- name: Inactivate deployments
7071
id: inactivate-deployment
71-
uses: im-open/[email protected].1
72+
uses: im-open/[email protected].2
7273
with:
7374
workflow-actor: ${{ github.actor }}
7475
token: ${{ secrets.GITHUB_TOKEN }}
75-
environment: ${{ github.event.inputs.environment }}
76+
environment: ${{ inputs.environment }}
7677
entity: inactivate-github-deployment
77-
instance: ${{ github.event.inputs.instance }}
78+
instance: ${{ inputs.instance }}
79+
80+
cleanup-slot-deployments:
81+
environment: ${{ inputs.environment }}
82+
runs-on: [ubuntu-20.04]
83+
84+
steps:
85+
...
86+
# Environment cleanup steps
87+
...
88+
89+
inactivate-deployment:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Inactivate deployments
93+
id: inactivate-deployment
94+
uses: im-open/[email protected]
95+
with:
96+
workflow-actor: ${{ github.actor }}
97+
token: ${{ secrets.GITHUB_TOKEN }}
98+
environment: ${{ inputs.environment }}
99+
entities: '[{"entity": "my-app", "instance": "na26"}]'
78100
```
79101
80102
## Contributing

action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ inputs:
1313
required: true
1414
entity:
1515
description: The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db"
16-
required: true
16+
required: false
1717
instance:
1818
description: A freeform identifier to distinguish separately deployed instances of the entity in the same environment. Typical uses would be to name a slot and/or region, e.g "NA26", "NA26-slot1", "NA27-blue", "Primary", "Secondary", etc.
19-
required: true
20-
19+
required: false
20+
entities:
21+
description: "JSON array of entity/instance objects to inactivate for an environment. Object has properties of entity, and instance. Example: [{'entity':'proj-app','instance':'NA26'},{'entity':'proj-infrastructure','instance':'NA26'}]"
22+
required: false
2123
runs:
2224
using: node20
2325
main: dist/index.js

0 commit comments

Comments
 (0)