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

PR2 #33

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

PR2 #33

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0d2183b
Update greetings.yml
CarlosJoseChaconChavarria May 26, 2024
f5f1b1b
Update greetings.yml
CarlosJoseChaconChavarria May 26, 2024
4e65d9f
Update greetings.yml
CarlosJoseChaconChavarria May 26, 2024
faf0642
4
CarlosJoseChaconChavarria May 26, 2024
e7909ac
- cron: '*/1 * * * *'
CarlosJoseChaconChavarria May 26, 2024
4f9a863
Update schedule.yml
CarlosJoseChaconChavarria May 26, 2024
816731d
Update schedule.yml
CarlosJoseChaconChavarria May 26, 2024
e648a24
xxx
CarlosJoseChaconChavarria May 26, 2024
b954538
name: Echo current time is now
CarlosJoseChaconChavarria May 26, 2024
18d5df9
H
CarlosJoseChaconChavarria May 26, 2024
e466b89
0 */4 * * *
CarlosJoseChaconChavarria May 26, 2024
33b4e6f
saedd
CarlosJoseChaconChavarria May 26, 2024
1f40054
# Changes in DEV
CarlosJoseChaconChavarria May 26, 2024
de88478
Merge pull request #2 from Cert-Organization/dev
CarlosJoseChaconChavarria May 26, 2024
4fb5a7b
part 2
CarlosJoseChaconChavarria May 26, 2024
fe86229
Merge pull request #3 from Cert-Organization/dev
CarlosJoseChaconChavarria May 26, 2024
907f59c
files
CarlosJoseChaconChavarria May 26, 2024
5c6def4
adding names
CarlosJoseChaconChavarria May 26, 2024
51ab32e
false
CarlosJoseChaconChavarria May 26, 2024
992868d
changes
CarlosJoseChaconChavarria May 27, 2024
badcafc
webhook
CarlosJoseChaconChavarria May 27, 2024
57ea153
echo "Event Type" $GITHUB_EVENT_NAME
CarlosJoseChaconChavarria May 27, 2024
5735595
name: "Webhook Event Example 1"
CarlosJoseChaconChavarria May 27, 2024
80dbb8b
Create WebhookEvent.yaml
CarlosJoseChaconChavarria May 27, 2024
b5b5e9d
name: "Webhook Event"
CarlosJoseChaconChavarria May 27, 2024
210c070
name: Conditional
CarlosJoseChaconChavarria May 27, 2024
5a8bfd4
Cert-Organization/Github-Examples or
CarlosJoseChaconChavarria May 27, 2024
8e511e3
name: Conditional If Equal Or
CarlosJoseChaconChavarria May 27, 2024
b16525b
exprssions
CarlosJoseChaconChavarria May 27, 2024
49ff170
name: Expression Functions
CarlosJoseChaconChavarria May 27, 2024
014e5a0
fixed
CarlosJoseChaconChavarria May 27, 2024
251acf8
on:
CarlosJoseChaconChavarria May 27, 2024
6b9cb52
runs-on: ubuntu-latest
CarlosJoseChaconChavarria May 27, 2024
cbb1ce0
♡ ♡ ♡
CarlosJoseChaconChavarria May 27, 2024
ae98cfd
echo -e "\033[31m♡ ♡ ♡${{ inputs.novia }} es mi novia y la quiero muc…
CarlosJoseChaconChavarria May 27, 2024
2e15196
MensajedeAmor:
CarlosJoseChaconChavarria May 27, 2024
fbbff6c
echo -e "\033[31m♡ ♡ ♡ \033[1m${{ inputs.novia }} ES MI NOVIA Y LA Q…
CarlosJoseChaconChavarria May 27, 2024
99b1314
♡ ♡ ♡
CarlosJoseChaconChavarria May 27, 2024
2203600
- name: From Exporting
CarlosJoseChaconChavarria May 27, 2024
b7161c4
- name: From Exporting
CarlosJoseChaconChavarria May 27, 2024
097f026
run: |
CarlosJoseChaconChavarria May 27, 2024
175b5d3
gg
CarlosJoseChaconChavarria May 27, 2024
4b04149
v
CarlosJoseChaconChavarria May 27, 2024
093a2db
name: Commands
CarlosJoseChaconChavarria May 27, 2024
f17a1de
echo $my_Var_3
CarlosJoseChaconChavarria May 27, 2024
b2e3765
>> $GITHUB_ENV
CarlosJoseChaconChavarria May 27, 2024
1a1397d
MY_ACTION: ${{github.action}}
CarlosJoseChaconChavarria May 27, 2024
c7b7da2
run: echo Hello
CarlosJoseChaconChavarria May 27, 2024
ffbaf01
https://docs.github.com/en/actions/learn-github-actions/contexts#gith…
CarlosJoseChaconChavarria May 27, 2024
7e0e76e
github.repositoryUrl
CarlosJoseChaconChavarria May 27, 2024
5b6055a
MY_ACTION
CarlosJoseChaconChavarria May 27, 2024
ad798dd
build:
CarlosJoseChaconChavarria May 27, 2024
7558f48
build:
CarlosJoseChaconChavarria May 27, 2024
299fc1b
moved
CarlosJoseChaconChavarria May 27, 2024
82eb418
dependancy
CarlosJoseChaconChavarria May 27, 2024
fced7f5
xx
CarlosJoseChaconChavarria May 27, 2024
de5cf6b
change order
CarlosJoseChaconChavarria May 27, 2024
011a503
.
CarlosJoseChaconChavarria May 27, 2024
c9f213d
name: Using ENV global, job and step
CarlosJoseChaconChavarria May 27, 2024
f235d3c
CarlosJoseChaconChavarria May 27, 2024
f53fccd
# using ENV variables in different locations Global, Job and Step
CarlosJoseChaconChavarria May 27, 2024
6439c88
ccc
CarlosJoseChaconChavarria Jun 1, 2024
65fe1b1
on: [push]
CarlosJoseChaconChavarria Jun 1, 2024
cf52634
d
CarlosJoseChaconChavarria Jun 1, 2024
d897f51
name: Conditional If Equal Or
CarlosJoseChaconChavarria Jun 2, 2024
ff3bb54
ss
CarlosJoseChaconChavarria Jun 2, 2024
fd7e1bd
name: Steps and Outputs
CarlosJoseChaconChavarria Jun 2, 2024
b282ceb
run: echo "number=$RANDOM"
CarlosJoseChaconChavarria Jun 2, 2024
f71ecf3
cc
CarlosJoseChaconChavarria Jun 2, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Bash Script
name: Run Bash Script Original

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .github/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJncmVldGluZyI6ICJIZWxsbyIsICJuYW1lIjogIkNhbGkifQ==
File renamed without changes.
52 changes: 52 additions & 0 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Node.js CI

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

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'latest'

- name: Restore Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install dependencies
run: npm install

- name: Save Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}

- name: Run tests
run: npm test
if: github.ref == 'refs/heads/main'

- name: Build project
run: npm run build

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: my-app
path: dist/
18 changes: 18 additions & 0 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Commands

on: ['push']

jobs:
commands:
runs-on: ubuntu-latest
steps:
- name: Exporting Var
run: |
echo "my_Var=Cali is my Name" >> $GITHUB_ENV
echo "my_Var_2=Sammy is my GF" >> $GITHUB_ENV
echo "my_Var_3=Yahoo mi password" >> $GITHUB_ENV
- name: From Exporting
run: |
echo $my_Var
echo $my_Var_2
echo $my_Var_3
15 changes: 15 additions & 0 deletions .github/workflows/conditional-if-or.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Conditional If Equal Or
# since this time is including an or for my repo it will run as opossed to conditonal.yml
on: [push]
jobs:
hello-world:
if: github.repository == 'octo-org/octo-repo-prod' || github.repository == 'Cert-Organization/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!"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: example-workflow
name: Conditional If Equal
on: [push]
jobs:
hello-world:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/contexts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Contexts

on: ['push']

jobs:
my_contexts:
runs-on: ubuntu-latest ## https://docs.github.com/en/actions/learn-github-actions/contexts#github-context ##
steps:
- name: myContexts
run: |
echo "Action next: $MY_ACTION"
env:
MY_ACTION: ${{github.action}}
MY_REPO: ${{ github.action_repository }}
MY_ACTOR: ${{ github.actor }}
MY_REPO_OWNER: ${{ github.repository_owner }}
MY_REPO_URL: ${{ github.repositoryUrl }}
2 changes: 2 additions & 0 deletions .github/workflows/custom-action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Custom

on: [push]

jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Test, and Deploy Workflow
name: Dependant Jobs 1 Build, Test, and Deploy Workflow

on:
push:
Expand All @@ -7,22 +7,32 @@ on:

jobs:
deploy:
needs: [build, test]
needs: [packaging, build, test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy application
run: echo "Deploying to production..."
build:
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Test application
run: echo "Running tests..."

build:
needs: packaging
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build application
run: echo "Building the application..."
test:
needs: build

packaging:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/dependent-jobs_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Dependant Jobs 2 Build, Test, and Deploy Workflow

on:
push:
branches:
- main

jobs:

packaging:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Test application
run: echo "Running tests..."
test:
needs: packaging
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Test application
run: echo "Running tests..."

build:
needs: packaging
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build application
run: echo "Building the application..."

deploy:
needs: [build, test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy application
run: echo "Deploying to production..."
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Expression Functions Demo
name: Expression Functions

on:
push:
Expand All @@ -24,14 +24,20 @@ jobs:
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, ', ') }}"
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) }}"
run: |
echo "Job context in JSON: ${{ toJSON(github.job) }}"
- name: Parse JSON string
run: echo "Parsed JSON: ${{ fromJSON('{"hello":"world"}').hello }}"
run: |
echo "Parsed JSON: ${{ fromJSON('{"hello":"world"}').hello }}"
- name: Hash files
run: echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}
run: |
echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}"
- name: The job has succeeded
if: ${{ success() }}
run: echo "The job has succeeded."
- name: The job has failed
if: ${{ failure() }}
if: ${{ failure() }}
run: echo "The job has failed."
22 changes: 22 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Couple♡ ♡ ♡

on:
workflow_dispatch:
inputs:
novio:
description: 'Nombre del Novio'
required: true
type: string
novia:
description: 'Nombre del Novia'
required: true
type: string

jobs:
MensajedeAmor:
runs-on: ubuntu-latest
steps:
- name: Mensaje de Amor
run: |
echo "${{ inputs.novio}} y ${{ inputs.novia }}!"
echo -e "\033[31m♡ ♡ ♡ \033[1m${{ inputs.novia }} ES MI NOVIA Y LA QUIERO MUCHO ♡ ♡ ♡\033[0m"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Multi-Event

on:
push:
branches:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/outputs-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Jobs and Outputs

on:
push:

jobs:
random-number-generator:
runs-on: ubuntu-latest
outputs:
number: ${{ steps.generate-number.outputs.number }}
steps:
- name: Generate number
id: generate-number
run: echo "number=$RANDOM" >> $GITHUB_OUTPUT

consumer-of-generator:
needs: random-number-generator
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use generated number
run: echo "The number is ${{ needs.random-number-generator.outputs.number }}"
20 changes: 20 additions & 0 deletions .github/workflows/outputs-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Steps and Outputs

on:
push:

jobs:
build:
runs-on: ubuntu-latest

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

- name: Generate number
id: generate-number
run: echo "number=$RANDOM" >> $GITHUB_OUTPUT

- name: Use number
id: use-number
run: echo "The number is ${{ steps.generate-number.outputs.number }}"
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Schedule

on:
schedule:
- cron: '*/5 * * * *'
- cron: '0 */4 * * *'

jobs:
hello_world:
runs-on: ubuntu-latest
steps:
- name: Echo current time
- name: Echo current time is now
run: echo "The current server time is $(date)"
20 changes: 20 additions & 0 deletions .github/workflows/variables-ENV.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Using ENV global, job and step
# using ENV variables in different locations Global, Job and Step

on: ['push']

env:
globalEnvDay: Monday
jobs:
usingEnvVariables:
runs-on: ubuntu-latest
env:
jobEnvDay: "Tuesday"
steps:
- name: Exporting Var
env:
stepEnvDay: "Webnesday"
run: |
echo "Firt Day: $globalEnvDay"
echo "Second Day: $jobEnvDay"
echo "Firt Day: $stepEnvDay"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Webhook Event example"
name: "Webhook Event"

on:
repository_dispatch:
Expand All @@ -9,7 +9,8 @@ jobs:
respond-to-dispatch:
runs-on: ubuntu-latest
steps:
- name Checkout repo
- name: Checkout repo
uses: actions/checkout@v2
- name: Run a script
run: echo "Event of type: $GITHUB_EVENT_NAME"
run: |
echo "Event Type" $GITHUB_EVENT_NAME
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
1 change: 1 addition & 0 deletions github-actions/templates/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Adding my comment 34
name: Greetings

on: [pull_request_target, issues]
Expand Down
Loading