Skip to content

qwer #251

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

qwer #251

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e6469f3
Create greetings.yml
ammararsiwala Mar 18, 2025
94f3234
Update greetings.yml
ammararsiwala Mar 18, 2025
47d6a9a
Update greetings.yml
ammararsiwala Mar 18, 2025
878a29a
Update custom-action.yml
ammararsiwala Mar 18, 2025
1d78935
Update greetings.yml
ammararsiwala Mar 18, 2025
1c8a0f3
Create repo-dispatch.yml
ammararsiwala Mar 18, 2025
febd904
Create scheduled_jobs.yml
ammararsiwala Mar 19, 2025
82dd4f1
Create multi-trigger.yml
ammararsiwala Mar 19, 2025
b3637c1
Update multi-trigger.yml
ammararsiwala Mar 19, 2025
f092dc5
Create manual-worflow.yml
ammararsiwala Mar 19, 2025
d6c1ae8
Create hello.py
ammararsiwala Mar 19, 2025
d93779d
Update hello.py
ammararsiwala Mar 19, 2025
cc8863d
Update manual-worflow.yml
ammararsiwala Mar 19, 2025
d7c04ef
Create hello_2.py
ammararsiwala Mar 19, 2025
685d5bd
Update hello_2.py
ammararsiwala Mar 19, 2025
15dbd75
Create repository-dispatch.yml
ammararsiwala Mar 24, 2025
04bb26b
Update repository-dispatch.yml
ammararsiwala Mar 24, 2025
9a872b5
Update multi-trigger.yml
ammararsiwala Mar 24, 2025
8d25c79
Update repository-dispatch.yml
ammararsiwala Mar 24, 2025
14eda17
Create conditional.yml
ammararsiwala Mar 24, 2025
8ae4614
Update conditional.yml
ammararsiwala Mar 24, 2025
f7cde07
Update conditional.yml
ammararsiwala Mar 24, 2025
5a10f69
Update conditional.yml
ammararsiwala Mar 24, 2025
4dc3569
Update conditional.yml
ammararsiwala Mar 24, 2025
ef7c9b5
Create functions.yml
ammararsiwala Apr 1, 2025
e9fbaa2
Update functions.yml
ammararsiwala Apr 1, 2025
9d8e2a5
Update functions.yml
ammararsiwala Apr 1, 2025
ea0fe8c
Update functions.yml
ammararsiwala Apr 1, 2025
8c78c4c
Update functions.yml
ammararsiwala Apr 1, 2025
7df8098
Update conditional.yml
ammararsiwala Apr 1, 2025
2029b60
Update functions.yml
ammararsiwala Apr 1, 2025
e792d44
Update functions.yml
ammararsiwala Apr 1, 2025
d6b812f
Update functions.yml
ammararsiwala Apr 1, 2025
12ab2ef
Update functions.yml
ammararsiwala Apr 1, 2025
e520755
Create commands.yml
ammararsiwala Apr 1, 2025
cf40a87
Update scheduled_jobs.yml
ammararsiwala Apr 1, 2025
89c8800
Update commands.yml
ammararsiwala Apr 1, 2025
a8bab10
Create dependent-jobs.yml
ammararsiwala Apr 2, 2025
0793eab
Update dependent-jobs.yml
ammararsiwala Apr 2, 2025
111dc6b
Create setting-environment-variables.yml
ammararsiwala Apr 2, 2025
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
23 changes: 23 additions & 0 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: To run diff commands in git actions

on:
workflow_dispatch

jobs:
new-job:
runs-on: ubuntu-latest
steps:
- name: Grouping
run: |
echo "::grouping:: Grouped Messages"
echo "msg1"
echo "msg2"
echo "msg3"
echo "::endgroup::"

- name: Step 1
run: |
echo "MY_PAT = hello" > $GITHUB_ENV
- name: Step 2
run: |
echo $MY_PAT
28 changes: 28 additions & 0 deletions .github/workflows/conditional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: This is to learn about conditional workflows

on: pull_request


jobs:
first_job:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Print a constant message
run: echo "Hello this message will be printed irrespective of the message"

second_job:
if: github.repository == 'ammararsiwala/Github-Examples'
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Print a variable message
run: echo "Hello this message will be printed only if the repo name is correct"




6 changes: 3 additions & 3 deletions .github/workflows/custom-action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on: [push]

on:
workflow_dispatch:
jobs:
my-job:
runs-on: ubuntu-latest
Expand All @@ -12,4 +12,4 @@ jobs:
name: 'Brown'
# Use the output from the `hello` step
- name: Get the Output
run: echo "The time was ${{ steps.hello.outputs.greeting }}"
run: echo "The time was ${{ steps.hello.outputs.greeting }}"
18 changes: 18 additions & 0 deletions .github/workflows/dependent-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Workflow to learn about dependent jobs

on:
push

jobs:
job1:
runs-on: windows-latest
steps:
- run: |
echo "World"

job2:
runs-on: ubuntu-latest
needs: job1
steps:
- run: |
echo "Hello"
23 changes: 23 additions & 0 deletions .github/workflows/functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: This workflow is basically used to learn different types of functions

on:
push

env:
STR: "Ammar"
SUBSTRING: "mmmmmmmmm"

jobs:
function-checkers:
runs-on: ubuntu-latest
steps:
- name: Check if string contains sub-strings
env:
l1: ${{ env.STR }}
l2: ${{ env.SUBSTRING }}
if: contains(env.l1, env.l2)
run: echo "Substring present"

- name: Substring Not Present
if: ${{ !contains(env.l1, env.l2) }}
run: echo "Not Present"
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: [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"
28 changes: 28 additions & 0 deletions .github/workflows/manual-worflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: This is to learn the manual dispatch of workflows

on:
workflow_dispatch:
inputs:
script_name:
required: true
description: 'Please choose the name of the .py you want to execute'
default: "hello.py"
type: choice
options:
- "hello.py"
- "hello_1.py"
- "hello_2.py"
- "hello_3.py"


jobs:
manual_dispatch:
runs-on: ubuntu-latest
steps :
- name: Code Checkout
uses: actions/checkout@v4

- name: Run Python script
run : python ${{github.event.inputs.script_name}}


15 changes: 15 additions & 0 deletions .github/workflows/multi-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: This is a workflow which has multiple triggers

on:
workflow_dispatch:

jobs:
job_name:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Checking a few commands
run: |
echo "The job id is $GITHUB_JOB"
15 changes: 15 additions & 0 deletions .github/workflows/repo-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Repo-Dispatch-Testing

on:
repository_dispatch:
types: [my-event]

jobs:
new-job:
runs-on: ubuntu-latest
steps:
- name: Checking out the code
uses: actions/checkout@v4

- name: Checking Which Event
run: echo " The Event is ${{github.event.action}} "
17 changes: 17 additions & 0 deletions .github/workflows/repository-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: This is to learn how to use repository-dispatch

on:
repository_dispatch:
types: [webhook]

jobs:
running-repodispatch:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Printing the event name
run: echo "The GitHub event is ${{ github.event_name }}"


16 changes: 16 additions & 0 deletions .github/workflows/scheduled_jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Practise workflow to learn about cron jobs

on:
schedule:
- cron: "*0 0 1 1 *"

jobs:
check_workflow:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Printing the date after every 5 minutes
run: echo " The date at which this workflow is running is ${date}"

18 changes: 18 additions & 0 deletions .github/workflows/setting-environment-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: This is a workflow to test env variables

on:
workflow_dispatch

jobs:
test:
runs-on: ubuntu-latest
steps:

- name: Trying to add a value
run: |
echo "MY_NEW=hello" >> $GITHUB_ENV

- name: Printing that value
run: |
echo "the value stored in the file is $MY_NEW"

1 change: 1 addition & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("hello world")
1 change: 1 addition & 0 deletions hello_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("This is to print hello 2")