Skip to content

Commit 409e33e

Browse files
committed
chore: logs and remove wrong environments
1 parent f1b2161 commit 409e33e

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,22 @@ jobs:
3838
token: ${{github.token}}
3939
type: delete
4040
deployment_id: ${{steps.create.outputs.deployment_id}}
41+
- uses: ./
42+
with:
43+
token: ${{github.token}}
44+
type: create
45+
- uses: ./
46+
with:
47+
token: ${{github.token}}
48+
type: delete
49+
deployment_id: 248141623
50+
- uses: ./
51+
with:
52+
token: ${{github.token}}
53+
type: delete
54+
deployment_id: 248139855
55+
- uses: ./
56+
with:
57+
token: ${{github.token}}
58+
type: delete
59+
deployment_id: 248137552

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ inputs:
1717
deployment_id:
1818
required: false
1919
description: an id for deployment if 'delete' or 'finish' type is used
20+
status:
21+
required: false
22+
description: status for created or finished deployment
23+
environment:
24+
required: false
25+
description: environment to create or delete all deployments in, default to context.ref without prefixes ('refs/heads/', 'deploy-')
2026
runs:
2127
using: 'node12'
2228
main: 'dist/index.js'

dist/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,11 +3553,12 @@ function run() {
35533553
let environmentUrl;
35543554
let deploymentId;
35553555
const { actor, ref } = github.context;
3556-
console.log('Context..');
3556+
console.log('### context ###');
35573557
console.log(`actor: ${actor}`);
35583558
console.log(`ref: ${ref}`);
3559+
console.log('\n');
35593560
try {
3560-
console.log('Inputs..');
3561+
console.log('### inputs ###');
35613562
token = (_a = getInput('token', { required: true })) !== null && _a !== void 0 ? _a : '';
35623563
type = getInput('type', { required: true });
35633564
console.log(`type: ${type}`);
@@ -3581,7 +3582,9 @@ function run() {
35813582
core.setFailed(`Wrong parameters given: ${JSON.stringify(error, null, 2)}`);
35823583
throw error;
35833584
}
3585+
console.log('\n');
35843586
const client = new github.GitHub(token, { previews: ['ant-man', 'flash'] });
3587+
console.log('### run ###');
35853588
switch (type) {
35863589
case 'create':
35873590
try {

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ export async function run (): Promise<void> {
3131

3232
const { actor, ref } = github.context
3333

34-
console.log('Context..')
34+
console.log('### context ###')
3535
console.log(`actor: ${actor}`)
3636
console.log(`ref: ${ref}`)
37+
console.log('\n')
3738

3839
try {
39-
console.log('Inputs..')
40+
console.log('### inputs ###')
4041
token = getInput('token', { required: true }) ?? ''
4142

4243
type = getInput('type', { required: true }) as ActionType
@@ -66,9 +67,12 @@ export async function run (): Promise<void> {
6667
core.setFailed(`Wrong parameters given: ${JSON.stringify(error, null, 2)}`)
6768
throw error
6869
}
70+
console.log('\n')
6971

7072
const client = new github.GitHub(token, { previews: ['ant-man', 'flash'] })
7173

74+
console.log('### run ###')
75+
7276
switch (type) {
7377
case 'create':
7478
try {

tests/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('delete-all', () => {
164164
})
165165
})
166166

167-
describe('delete-all', () => {
167+
describe('delete', () => {
168168
beforeEach(() => {
169169
process.env['GITHUB_REPOSITORY'] = 'owner/repo'
170170

0 commit comments

Comments
 (0)