Comparison of GitHub Actions with competitors
Deep dive into workflow syntax, triggers, and job configuration
Explore matrices, reusable workflows, and composite actions
•Runner Types and Execution Environments
•Persisting Build Outputs with Artifacts
•Controlling GitHub Permissions
Discover and integrate community actions from the GitHub Marketplace
Build custom JavaScript and Docker actions from scratch
•JavaScript and TypeScript Actions
Optimize logs, secrets, environments, and permissions for teams
•Developer Experience (Actions)
Harden workflows with security, reliability, and cost-saving techniques
•Maintainable Workflow Patterns
Apply course concepts by automating a real-world deployment pipeline
JavaScript-based actions are first-class citizens on GitHub: you can import
@actions/core
to read inputs, emit logs, set outputs, or fail the run. Even
TypeScript actions must be compiled to JavaScript before publishing, so a
typical project contains a build step that bundles your sources into
dist/index.js
.
name: 'Wait Timer'
inputs:
milliseconds:
description: 'Duration to wait before finishing'
required: true
runs:
using: node20
main: dist/index.js
import * as core from '@actions/core'
import { wait } from './wait.js'
/**
* The main function for the action.
*
* @returns Resolves when the action is complete.
*/
export async function run(): Promise<void> {
try {
const ms: string = core.getInput('milliseconds')
// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
core.debug(`Waiting ${ms} milliseconds ...`)
core.info('hello, this is another info level log!')
// Log the current timestamp, wait, then log the new timestamp
core.debug(new Date().toTimeString())
await wait(parseInt(ms, 10))
core.debug(new Date().toTimeString())
// Set outputs for other workflow steps to use
core.setOutput('time', new Date().toTimeString())
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
}
}
Run npm run package
(from the template directory) to transpile and bundle the action.
The JavaScript and TypeScript examples in the companion repo demonstrate three
variants:
node_modules
(handy for demos
but hard to maintain).