Skip to content

Commit

Permalink
new action
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin Smith committed Jan 4, 2024
1 parent 2569dc7 commit 9e7daa3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/export-to-serverlessland.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Manual trigger that will Copy pattern to SLand
name: Manual Copy to SLand

on:
workflow_dispatch:
inputs:
fileName:
description: "new pattern filename"
required: true
dirName:
description: "new pattern dir"
required: true

jobs:
copy:
runs-on: ubuntu-latest
if: github.actor != 'bls20aws'
env:
NODE_ENV: dev
fileName: ${{ inputs.fileName }}
steps:
- name: Copycat
uses: andstor/copycat-action@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
dst_path: /content/patterns/
dst_owner: bls20aws
dst_repo_name: serverless-land
dst_branch: master
src_branch: master
file_filter: "*.json"
src_path: ${{ inputs.dirName }}/${{ inputs.fileName }}
10 changes: 5 additions & 5 deletions eventbridge-sfn-redrive/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
* SPDX-License-Identifier: MIT-0
*/

const { StepFunctions } = require('@aws-sdk/client-sfn');
const { SFNClient, StartExecutionCommand } = require('@aws-sdk/client-sfn');

exports.handler = async (event) => {
try {
// Define the Step Functions client
const stepFunctions = new StepFunctions({});
const stepFunctions = new SFNClient({});

// Define the parameters for the redriveExecution operation
// Define the parameters for the StartExecutionCommand
const params = {
stateMachineArn: event.detail.executionArn
};

// Start the Step Functions workflow
const result = await stepFunctions.redriveExecution(params);
const result = await stepFunctions.send(new StartExecutionCommand(params));

console.log('Workflow redriven:', result.executionArn);
console.log('Workflow started:', result.executionArn);

return {
statusCode: 200,
Expand Down
14 changes: 14 additions & 0 deletions eventbridge-sfn-redrive/src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "src",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-sfn": "^3.449.0"
}
}

0 comments on commit 9e7daa3

Please sign in to comment.