Skip to content

Commit 6574fdb

Browse files
committed
improve devx workflows
1 parent 19a4f7d commit 6574fdb

6 files changed

Lines changed: 99 additions & 23 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Workflow Iteration (Externalize Logic)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
# ❌ Avoid inline bash for anything except trivial commands
8+
say-hello-inline-bash:
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- name: Echo Hello
12+
run: |
13+
echo "Hello from an inline bash script in a GitHub Action Workflow!"
14+
15+
# ✅ Instead, move the logic outside of the workflow!
16+
say-hello-external-task:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
21+
- name: Install Task
22+
uses: supplypike/setup-bin@8e3f88b4f143d9b5c3497f0fc12d45c83c123787 # v4.0.1
23+
with:
24+
uri: "https://github.com/go-task/task/releases/download/v3.44.1/task_linux_amd64.tar.gz"
25+
name: task
26+
version: v3.44.1
27+
- name: Echo Hello
28+
working-directory: ./08-developer-experience/workflows
29+
run: |
30+
task hello-world-task
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Workflow Iteration (Breakpoint with SSH)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
fail-with-breakpoint:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- name: Fail
11+
run: |
12+
echo "Hello from an inline bash script in a GitHub Action Workflow!"
13+
- name: Breakpoint if failed
14+
if: failure()
15+
uses: namespacelabs/breakpoint-action@664d004eae0e89e248fafe14fd5e97d28440a85e # v0.0.13
16+
with:
17+
duration: 10m
18+
authorized-users: sidpalas
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Workflow Iteration (Breakpoint with SSH)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
# To see the debug logging in action:
8+
# 1. Run with no modified settings (default)
9+
# 2. Set ACTIONS_STEP_DEBUG repo VAR or SECRET to true
10+
# └─> (This will show the debug log defined in the step)
11+
# 3. Set ACTIONS_RUNNER_DEBUG repo VAR or SECRET to true
12+
# └─> (This will show the debug logs from the runner)
13+
log-at-various-levels:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Echo some things
17+
run: |
18+
echo "::debug This is a debug message"
19+
echo "::info This is an info message"
20+
echo "::warning This is an warning message"

08-developer-experience/Taskfile.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3"
2+
3+
tasks:
4+
typescript-action-run-local-action:
5+
desc: Run the typescript action with @github/local-action
6+
dir: ../../06-authoring-actions/javascript-actions/typescript-action-with-build
7+
cmds:
8+
- npm run local-action
9+
10+
typescript-action-test:
11+
desc: Run the typescript action with @github/local-action
12+
dir: ../../06-authoring-actions/javascript-actions/typescript-action-with-build
13+
cmds:
14+
- npm run test
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: "3"
2+
3+
tasks:
4+
# More examples can be found in the capstone project
5+
act-trigger-hello-world:
6+
cmds:
7+
- |
8+
act workflow_dispatch \
9+
--container-architecture linux/amd64 \
10+
-P ubuntu-24.04=node:16-bullseye-slim \
11+
--directory ../.. \
12+
-W '.github/workflows/08-developer-experience--01-externalize-logic.yaml'
13+
14+
hello-world-task:
15+
cmds:
16+
- |
17+
echo "Hello from a Taskfile task called from a GitHub Action Workflow!"

0 commit comments

Comments
 (0)