Finishes preparing the action

This commit is contained in:
Julien Lengrand-Lambert
2023-03-09 13:27:43 +01:00
parent 0986d2fb65
commit e5506ef379
4 changed files with 112 additions and 7050 deletions

View File

@@ -21,7 +21,4 @@ jobs:
with:
postman-key: ${{ secrets.POSTMAN_API_KEY }}
workspace-id: ${{ secrets.POSTMAN_WORKSPACE_ID }}
files-changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}
# Use the output from the `hello` step
- name: Get the output time
run: echo "The time was ${{ steps.process.outputs.time }}"
files-changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}

View File

@@ -1,5 +1,5 @@
name: 'Push Adyen Collections to Postman '
description: 'Greet someone and record the time'
description: 'Takes the list of changed files and pushes them to Postman in the given workspace, by either updating or creating new collections.'
inputs:
postman-key:
description: 'Postman API Key'
@@ -10,9 +10,6 @@ inputs:
files-changed:
description: 'Files changed'
required: true
outputs:
time: # id of output
description: 'The time we greeted you'
runs:
using: 'node16'
main: 'dist/index.js'

7135
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,18 +1,14 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as postman from './postmanLibrary.js';
import * as utils from "./utils.js";
async function run() {
try {
const postmanApiKey = core.getInput('postman-key');
const filesChanged = core.getInput('files-changed');
const workspaceId = core.getInput('workspace-id');
const time = runParameters(postmanApiKey, workspaceId, filesChanged);
// TODO : Change output to something better. Is there any output actually?
core.setOutput("time", time);
} catch (error) {
@@ -71,10 +67,13 @@ export async function runParameters(postmanApiKey, workspaceId, filesToProcess){
console.log(`No action for ${api.name}. Shouldn't happen!`);
}
}
return (new Date()).toTimeString();
console.log("Finished processing files!");
}
run()
run()
.then( _ => {
console.log("Finished action!");
})
.catch(err => {
console.log(err);
});