Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/your mom #143

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .github/workflows/.runner-windows.yml.swp
Binary file not shown.
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 == '1tchyBa11z/Github-Examples'
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!"
40 changes: 40 additions & 0 deletions .github/workflows/expression-functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Expression Functions Demo

on:
push:
branches:
- main
- feature/your-mom
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 ${{ format('Hello {0} {1} {2}', '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 ${{ fromJSON('{"hello":"world"}').hello }}\"
- name: Hash files
run: echo "Hash of files ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}"
- name: The job has succeeded
if: ${{ success() }}
run: "echo SUCCESS!"
- name: The job has failed
if: ${{ failure() }}
run: "echo SUCCESS!"
32 changes: 32 additions & 0 deletions .github/workflows/manual-trigger.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
31 changes: 31 additions & 0 deletions .github/workflows/runner-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: macOS Workflow Example

on:
push:
branches:
- main
- feature/your-mom

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
36 changes: 36 additions & 0 deletions .github/workflows/runner-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Windows Workflow Example

on:
push:
branches:
- main
- feature/your-mom

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
16 changes: 16 additions & 0 deletions .github/workflows/webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Webhook Event example"

on:
repository_dispatch:
types:
- webhook
jobs:
respond-to-dispatch:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run a script
run: echo "Event of type - $GITHUB_EVENT_NAME"


1 change: 1 addition & 0 deletions .gitinnore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp
File renamed without changes.
16 changes: 16 additions & 0 deletions github-actions/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings
on: [push]

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 onm users first pr"

20 changes: 20 additions & 0 deletions github-actions/multiple-events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: multi events cunts
on:
push:
branches:
- main
- feature/your-mom
pull_request:
branches:
- main
- pulled/yer-mam
jobs:
hello_yer-mam:
runs-on: ubuntu-latest
steps:
- name: "Echo yer mam's basic"
run: |
echo "REF: $GITHUB_REF"
echo "Job ID: $GITHUB_JOB"
echo "Action: $GITHUB_ACTION"
echo "Actor: $GITHUB_ACTOR"
14 changes: 14 additions & 0 deletions github-actions/schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
push:
branches:
- main
schedule:
- cron: '*/2 * * * * '

jobs:
hello_cunt:
runs-on: ubuntu-latest
steps:
- name: Echo current time
run: echo "The current time is $(date)"