-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy path04-advanced-features--08-workflow-commands.yaml
More file actions
72 lines (57 loc) · 2.36 KB
/
Copy path04-advanced-features--08-workflow-commands.yaml
File metadata and controls
72 lines (57 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Workflow Commands
on:
workflow_dispatch:
jobs:
demo:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
- name: Log annotations
run: |
# Debug output (visible only when repo secret ACTIONS_STEP_DEBUG=true)
echo "::debug::Step started - hello from debug"
file=".github/workflows/04-advanced-features--07-workflow-commands.yaml"
echo "::notice file=$file,line=23::By specifying a line (and optionally a column) the notice is linked to the source file"
echo "::warning title=Some Warning::A more detailed description of the warning"
# Fails the run visually, but does **not** stop execution (you should `exit 1` to stop execution)
echo "::error title=Some Error::A more detailed description of the error"
- name: Grouped logs
run: |
echo "::group::This is a group of logs"
echo "Hello from within the group! 👋"
echo "::endgroup::"
- name: Mask a value
env:
FOO: "bar"
run: |
echo "::add-mask::$FOO"
echo "FOO is $FOO" # This will print *** instead of "bar"
- name: Stop & resume workflow commands
run: |
marker=$(uuidgen)
echo "::stop-commands::$marker"
echo "::error::This is *not* rendered as an error"
echo "::$marker::" # resume processing
echo "::notice::Processing resumed"
- name: Set an environment variable
run: echo "BUILD_ID=$(date +%s)" >> "$GITHUB_ENV"
- name: Set a step output variable
id: pick-color
run: echo "choice=green" >> "$GITHUB_OUTPUT"
- name: Append to step summary
run: |
echo "### Build completed 🚀" >> $GITHUB_STEP_SUMMARY
echo "- Build ID: $BUILD_ID" >> $GITHUB_STEP_SUMMARY
echo "- Colour : ${{ steps.pick-color.outputs.choice }}" >> $GITHUB_STEP_SUMMARY
- name: Add custom path
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Use env, output, and PATH
env:
CHOSEN_COLOUR: ${{ steps.pick-color.outputs.CHOICE }}
run: |
echo "Current PATH is:"
echo "$PATH"
echo ""
echo "Build ID is $BUILD_ID"
echo "Chosen color is $CHOSEN_COLOUR"