When contributing to this repository, please first discuss the change you wish to make via GitHub Issue.
Adding a new Shortcut action is relatively straightforward.
- Create a test Shortcut on your iOS device containing the new action.
- Airdrop the Shortcut to your development machine.
- Move it into a
/shortcuts
directory in the root of this project. - Run
node scripts/parse.js
and select your Shortcut and action. This will log out the parsed Shortcut data. - Copy this data into a new file in
src/actions
, optionally using an existing action as a template. - Connect up all Shortcut options to the function parameters. Try to be as thorough as possible and make sure you cover all possible options. You'll likely need to add some new types to
src/interfaces/WF
andsrc/interfaces/WF/WFWorkflowActionParameters.ts
. You'll also want to check whether or not the action can be used as a 'Magic Variable'. If it can, don't forget to wrap the exported function with thewithUUID
function (seesrc/actions/number.ts
as an example). - Export the new file from
src/actions/index.ts
. - Add tests for the new action to
__tests__/actions
. Again, try to be as thorough as possible and use another action's tests as a starting point. - Make sure all tests pass, and that the new action is documented with JSDoc in the same way all other actions are.
- Build a test Shortcut and Airdrop it to your phone to make sure that the new action works as expected.
- Open a Pull Request!