Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-and-review-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ jobs:
# The npm script to run to build the action. This is typically 'npm run build' if the
# action needs to be compiled. For composite-run-steps actions this is typically empty.
build-command: 'npm run build'
node-version: '22'
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ This action inactivates GitHub Deployments and Deployment Statuses through [GitH
| `workflow-actor` | true | The GitHub user who triggered the workflow |
| `token` | true | A token with `repo_deployment` permissions to create and update issues, workflows using this action should be granted `permissions` of `deployments: write` |
| `environment` | true | The environment the release was deployed to, i.e. [Dev\|QA\|Stage\|Demo\|UAT\|Prod] |
| `entity` | true | The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db" |
| `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" |
| `entity` | false | Required if entities are null. The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db" |
| `instance` | false | Required if entities are null. 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" |
| `entities` | false | Required if entity and instance are null. 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'}]` |

## Usage Example

Expand Down Expand Up @@ -55,7 +56,7 @@ permissions:

jobs:
deploy-different-ways:
environment: ${{ github.event.inputs.environment }}
environment: ${{ inputs.environment }}
runs-on: [ubuntu-20.04]

steps:
Expand All @@ -68,13 +69,34 @@ jobs:
steps:
- name: Inactivate deployments
id: inactivate-deployment
uses: im-open/[email protected].1
uses: im-open/[email protected].2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in the API/Action Arguments, this would warrant a whole version change.

with:
workflow-actor: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
environment: ${{ github.event.inputs.environment }}
environment: ${{ inputs.environment }}
entity: inactivate-github-deployment
instance: ${{ github.event.inputs.instance }}
instance: ${{ inputs.instance }}

cleanup-slot-deployments:
environment: ${{ inputs.environment }}
runs-on: [ubuntu-20.04]

steps:
...
# Environment cleanup steps
...

inactivate-deployment:
runs-on: ubuntu-latest
steps:
- name: Inactivate deployments
id: inactivate-deployment
uses: im-open/[email protected]
with:
workflow-actor: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
environment: ${{ inputs.environment }}
entities: '[{"entity": "my-app", "instance": "na26-blue"}]'
```

## Contributing
Expand Down
8 changes: 5 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ inputs:
required: true
entity:
description: The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db"
required: true
required: false
instance:
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.
required: true

required: false
entities:
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'}]"
required: false
runs:
using: node20
main: dist/index.js
Loading
Loading