Skip to content

Commit

Permalink
chore: Update GitHub Actions training link in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
timothywarner committed Aug 7, 2024
1 parent 6f1fa67 commit 71cfb26
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Check Links
name: O'Reilly - Check Links

on:
workflow_dispatch:

push:
branches:
- main
schedule:
- cron: "0 7 * * *"
pull_request: # Added pull request trigger
branches:
- main
jobs:
linkChecker:
runs-on: ubuntu-latest
Expand All @@ -12,4 +19,4 @@ jobs:
- name: Check links in README.md
uses: lycheeverse/[email protected]
with:
args: ./README2.md
args: ./README.md
24 changes: 24 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on: [push]

jobs:
hello_world_job:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v2

# Run Hello World Action from the same repository
- name: Run Hello World Action
uses: ./hello-world-action # Uses an action in the hello-world-action directory
with:
name: 'Timothy'

# Example of referencing a custom action from another repository
# - name: Run Another Custom Action
# uses: timothywarner-org/another-repo@v1
# with:
# name: 'Example'
22 changes: 22 additions & 0 deletions hello-world-action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Hello World JavaScript Action

This action prints "Hello [name]!" to the log.

## Inputs

### `name`

**Required** The name to greet. Default is `"World"`.

## Outputs

### `time`

The time we greeted you.

## Example usage

```yaml
uses: timothywarner-org/actions-cert-prep@v1
with:
name: 'Timothy'
Empty file added hello-world-action/action.yml
Empty file.
18 changes: 18 additions & 0 deletions hello-world-action/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const core = require('@actions/core');
const github = require('@actions/github');

try {
// `name` input defined in action metadata file
const name = core.getInput('name');
console.log(`Hello ${name}!`);

// Get the current time
const time = (new Date()).toTimeString();
core.setOutput("time", time);

// Get the JSON webhook payload for the event that triggered the workflow
const payload = JSON.stringify(github.context.payload, undefined, 2)
console.log(`The event payload: ${payload}`);
} catch (error) {
core.setFailed(error.message);
}

0 comments on commit 71cfb26

Please sign in to comment.