Skip to content

Commit 59e85de

Browse files
authored
expression func example
1 parent 8b3a306 commit 59e85de

File tree

3 files changed

+35
-30
lines changed

3 files changed

+35
-30
lines changed

.github/workflows/conditional.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Expression Functions Demo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
expression-functions:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check if string contains substring
13+
if: contains('Hello world', 'llo')
14+
run: echo "The string contains the substring."
15+
- name: Check if string starts with
16+
if: startsWith('Hello world', 'He')
17+
run: echo "The string starts with 'He'."
18+
- name: Check if string ends with
19+
if: endsWith('Hello world', 'ld')
20+
run: echo "The string ends with 'ld'."
21+
- name: Format and echo string
22+
run: echo ${{ format('Hello {0} {1} {2}', 'Mona', 'the', 'Octocat') }}
23+
- name: Join issue labels
24+
if: github.event_name == 'issues'
25+
run: echo "Issue labels: ${{ join(github.event.issue.labels.*.name, ', ') }}"
26+
- name: Convert job context to JSON
27+
run: echo "Job context in JSON: ${{ toJSON(github.job) }}"
28+
- name: Parse JSON string
29+
run: echo "Parsed JSON: ${{ fromJSON('{"hello":"world"}').hello }}"
30+
- name: Hash files
31+
run: echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}
32+
- name: The job has succeeded
33+
if: ${{ success() }}
34+
- name: The job has failed
35+
if: ${{ failure() }}

.github/workflows/webhook.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)