Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6167d18
Create greetings.yml
george00-byte Apr 17, 2026
775f807
created a schedule cron
george00-byte Apr 21, 2026
34f3b21
Add scheduled workflow to echo current server time
george00-byte Apr 21, 2026
1dee13c
Update schedule.yaml
george00-byte Apr 21, 2026
4ef7e66
updated changes
george00-byte Apr 21, 2026
19df058
updated
george00-byte Apr 21, 2026
3760bc9
Fix cron syntax in schedule.yaml
george00-byte Apr 21, 2026
568c589
Fix cron syntax in schedule.yaml
george00-byte Apr 21, 2026
f6fa317
created multi- event action
george00-byte Apr 21, 2026
d92c7a8
Update multi-event.yaml to include job ID echo
george00-byte Apr 21, 2026
1e1bd16
Update CI workflow syntax and formatting
george00-byte Apr 21, 2026
da633ed
Add scheduled job to echo current server time
george00-byte Apr 21, 2026
a313f56
added manual worflows
george00-byte Apr 21, 2026
e6c436f
manual workflow
george00-byte Apr 21, 2026
84d1c4e
updated
george00-byte Apr 23, 2026
124b6f1
webhook action
george00-byte Apr 23, 2026
e50f93b
fixed
george00-byte Apr 23, 2026
e6350f4
Updated read me
george00-byte Apr 23, 2026
13a8738
update webhook
george00-byte Apr 23, 2026
abce1ad
Update webhook.yml for improved syntax and version
george00-byte Apr 23, 2026
b73d7b6
Fix echo command in webhook.yml
george00-byte Apr 23, 2026
cfdbed4
Update webhook.yml for repository_dispatch event
george00-byte Apr 23, 2026
c4a0b48
conditional statements
george00-byte Apr 24, 2026
15b2f31
conditional statements
george00-byte Apr 24, 2026
09fcef9
updated
george00-byte Apr 24, 2026
caa262a
updated
george00-byte Apr 24, 2026
9674941
expression functions
george00-byte Apr 24, 2026
37337d7
updated
george00-byte Apr 24, 2026
3ef4456
run on macOS
george00-byte Apr 24, 2026
988daed
runner onwindows
george00-byte Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/conditional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: example-workflow
on: [push]
jobs:
hello-world:
if: github.repository == 'octo-org/octo-repo-prod'
runs-on: ubuntu-latest
steps:
- name: "Hello World"
run: echo "Hello World!"
goodbye-moon:
runs-on: ubuntu-latest
steps:
- name: "Goodbye Moon"
run: echo "Goodbye Moon!"
52 changes: 52 additions & 0 deletions .github/workflows/expression-functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Expression Functions Demo

on:
push:
branches:
- main
issues:
types: [opened, labeled]

jobs:
expression-functions:
runs-on: ubuntu-latest
steps:
- name: Check if string contains substring
if: contains('Hello world', 'llo')
run: echo "The string contains the substring."

- name: Check if string starts with
if: startsWith('Hello world', 'He')
run: echo "The string starts with 'He'."

- name: Check if string ends with
if: endsWith('Hello world', 'ld')
run: echo "The string ends with 'ld'."

- name: Format and echo string
run: echo "Hello Mona the Octocat"

- name: Join issue labels
if: github.event_name == 'issues'
run: |
echo "Issue labels: ${{ join(github.event.issue.labels.*.name, ', ') }}"

- name: Convert job context to JSON
run: |
echo "Job context in JSON: ${{ toJSON(github.job) }}"

- name: Parse JSON string
run: |
echo "Parsed JSON: world"

- name: Hash files
run: |
echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}"

- name: The job has succeeded
if: success()
run: echo "Job succeeded"

- name: The job has failed
if: failure()
run: echo "Job failed"
16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Message that will be displayed on users' first issue"
pr-message: "Message that will be displayed on users' first pull request"
32 changes: 32 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Manual Trigger with Params

on:
workflow_dispatch:
inputs:
name:
description: 'Name of the person to greet'
required: true
type: string
greeting:
description: 'Type of greeting'
required: true
type: string
data:
description: 'Base64 encoded content of a file'
required: false
type: string

jobs:
greet:
runs-on: ubuntu-latest
steps:
- name: Decode File Content
run: |
echo "${{ inputs.data }}" | base64 --decode > ./decoded_file.txt
- name: Display Greeting
run: |
echo "${{ inputs.greeting }}, ${{ inputs.name }}!"
- name: Display File Content
run: |
echo "Contents of the file:"
cat ./decoded_file.txt
19 changes: 19 additions & 0 deletions .github/workflows/multi-event.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main

jobs:
hello_world:
runs-on: ubuntu-latest
steps:
- name: Echo Basic Information
run: |
echo "Ref: $GITHUB_REF"
echo "Job id: $GITHUB_JOB"
30 changes: 30 additions & 0 deletions .github/workflows/runner-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: macOS Workflow Example

on:
push:
branches:
- main

jobs:
build-and-test:
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create Swift File
run: |
echo 'print("Hello from Swift on macOS")' > hello.swift

- name: Install dependencies
run: |
brew install swiftlint

- name: Run SwiftLint
run: swiftlint

- name: Compile and run Swift program
run: |
swiftc hello.swift
./hello
38 changes: 38 additions & 0 deletions .github/workflows/runner-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Windows Workflow Example

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: choco install dotnetcore-sdk
shell: powershell

- name: Compile and run C# program
run: |
Add-Content -Path "Hello.cs" -Value @"
using System;
public class Hello
{
public static void Main()
{
Console.WriteLine("Hello, Windows from C#");
}
}
"@
dotnet new console --force --no-restore
Move-Item -Path "Hello.cs" -Destination "Program.cs" -Force
dotnet run
shell: powershell
12 changes: 12 additions & 0 deletions .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Scheduled Job

on:
schedule:
- cron: '*/1 * * * *' # every 1 minute

jobs:
hello_world:
runs-on: ubuntu-latest
steps:
- name: Echo current time
run: echo "The current server time is $(date)"
13 changes: 13 additions & 0 deletions .github/workflows/webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Webhook Event example"

on:
repository_dispatch:
types:
- webhook

jobs:
respond-to-dispatch:
runs-on: ubuntu-latest
steps:
- name: Run a script
run: 'echo "Event of type: $GITHUB_EVENT_NAME"'
10 changes: 7 additions & 3 deletions github-actions/Readme.me
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json
```sh
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token {PAT} \
-H "Authorization: token {gh
p_Yb21g6bpDT9gQmuOVNMZoZBnxfXsFj4fxwMI} \
-d '{"event_type": "webhook", "client_payload": {"key": "value"} }' \
https://api.github.com/repos/{owner}/{repo}/dispatches
```
https://github.com/repos/george00-byte/Github-Examples/dispatches
```


https://api.github.com/repos/{owner}/{repo}/dispatches
32 changes: 32 additions & 0 deletions github-actions/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Manual Trigger with Params

on:
workflow_dispatch:
inputs:
name:
description: 'Name of the person to greet'
required: true
type: string
greeting:
description: 'Type of greeting'
required: true
type: string
data:
description: 'Base64 encoded content of a file'
required: false
type: string

jobs:
greet:
runs-on: ubuntu-latest
steps:
- name: Decode File Content
run: |
echo "${{ inputs.data }}" | base64 --decode > ./decoded_file.txt
- name: Display Greeting
run: |
echo "${{ inputs.greeting }}, ${{ inputs.name }}!"
- name: Display File Content
run: |
echo "Contents of the file:"
cat ./decoded_file.txt
1 change: 1 addition & 0 deletions github-actions/mydata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SGVsbG8gbWFycw==
10 changes: 5 additions & 5 deletions github-actions/templates/webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: "Webhook Event example"

on:
repository_dispatch:
types:
- webhook
types: [webhook]

jobs:
respond-to-dispatch:
runs-on: ubuntu-latest
steps:
- name Checkout repo
uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@v3

- name: Run a script
run: echo "Event of type: $GITHUB_EVENT_NAME"
run: echo "Event of type: ${{ github.event_name }}"