Skip to content

Commit da66fc6

Browse files
authored
Merge pull request #5 from im-open/insensitive-instance
Insensitive-instance
2 parents c0a14d1 + 5d2a38c commit da66fc6

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ This action gets a list of GitHub deployments and statuses created by [im-open/c
2323
| ------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2424
| `token` | true | A token with `deployments:read` and `contents:read` to get the deployments and release reference data. |
2525
| `environment` | true | The name of a GitHub environment the release was deployed to, i.e. [Dev\|QA\|Stage\|Demo\|UAT\|Prod]. It will be used to filter deployment objects. |
26-
| `entity` | true | The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db" |
26+
| `entity` | true | The entity that is deployed, i.e. "proj-app", "proj-infrastruction" or "proj-db". |
2727
| `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", "Primary", "Secondary", etc. |
2828

29+
**`environment`, `entity`, and `instance` values will be searched in a case-insensitive manner.**
30+
2931
## Outputs
3032

3133
| Value | Description |
@@ -72,7 +74,7 @@ jobs:
7274
steps:
7375
- name: Get Deployments
7476
id: get-deployments
75-
uses: im-open/[email protected].1
77+
uses: im-open/[email protected].2
7678
with:
7779
token: ${{ secrets.GITHUB_TOKEN }}
7880
environment: ${{ github.event.inputs.environment }}

dist/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46418,7 +46418,11 @@ var require_deployments = __commonJS({
4641846418
};
4641946419
const restDeployments = (
4642046420
await octokit.paginate(octokit.rest.repos.listDeployments, params)
46421-
).filter(d => d.payload.entity == context.entity && d.payload.instance == context.instance);
46421+
).filter(
46422+
d =>
46423+
d.payload.entity.toString().toLowerCase() == context.entity.toString().toLowerCase() &&
46424+
d.payload.instance.toString().toLowerCase() == context.instance.toString().toLowerCase()
46425+
);
4642246426
const deploymentNodeIds = restDeployments.map(d => d.node_id);
4642346427
const statusesQuery = `
4642446428
query($deploymentNodeIds: [ID!]!) {

src/deployments.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ async function listDeployments(context) {
2121

2222
const restDeployments = (
2323
await octokit.paginate(octokit.rest.repos.listDeployments, params)
24-
).filter(d => d.payload.entity == context.entity && d.payload.instance == context.instance);
24+
).filter(
25+
d =>
26+
d.payload.entity.toString().toLowerCase() == context.entity.toString().toLowerCase() &&
27+
d.payload.instance.toString().toLowerCase() == context.instance.toString().toLowerCase()
28+
);
2529

2630
const deploymentNodeIds = restDeployments.map(d => d.node_id);
2731
const statusesQuery = `

0 commit comments

Comments
 (0)