🦕 Demo action using Deno
💡 Inspired by actions/hello-world-javascript-action
import * as core from "npm:@actions/core";
import * as github from "npm:@actions/github";
console.log(`Hello ${core.getInput("name")}!`);
core.setOutput("time", new Date().toLocaleTimeString()); |
🟦 Uses TypeScript
🦕 Runs on the Deno runtime
👩⚖️ 0BSD licensed template
This is a template repository that is meant to be used as a base or example
for your own project. To get started, just click the Use this
template button in the top left of this repository page and edit the
main.ts
file to customize your new Deno-based GitHub Action.
After instantiating this template repository, you will need to manually do the following:
- Write your code in the
main.ts
file. You can usenpm:
specifiers,http:
imports,node:
builtins, and evenDeno.*
APIs. - Make sure you edit the
.github/workflows/test-action.yml
test workflow if you want to test any additional inputs or scenarios. - Replace the
LICENSE
file with your preferred software license. Check out choosealicense.com if you're unsure of which one to pick. - Replace this
README.md
file with a fancy readme to suit your new GitHub Action. Make sure you document all your inputs & outputs! - Trigger the Draft release workflow manually to create a Draft release with the compiled Deno binaries embedded in the repository. After the workflow completes, you'll see a Draft item in the Releases tab. Now you can publish your new GitHub Action to the GitHub Actions Marketplace! 🚀
You'll notice that the example code uses npm:
imports to directly import from
npm. If you want to get more advanced, you can use an import map in a
deno.json
Deno configuration file to alias @actions/core
to a specific
version shared across your action.
// deno.json
{
"imports": {
"@actions/core": "npm:@actions/core@1.10.1",
"@actions/github": "npm:@actions/github@6.0.0"
}
} |
// main.ts
import * as core from "@actions/core";
import * as github from "@actions/github"; |