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

learning-github-actions #42

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
734b5bc
Create greetings.yml
mehtachandrashekhar Jun 8, 2024
5c9a3d8
cron workflow -/5min
mehtachandrashekhar Jun 9, 2024
499c41a
multi event trigger
mehtachandrashekhar Jun 9, 2024
75e0070
manual trigger
mehtachandrashekhar Jun 9, 2024
ec00561
added: manual workflow
mehtachandrashekhar Jun 9, 2024
d425a6b
workflow run
mehtachandrashekhar Jun 9, 2024
6eda110
workflow/webhook
mehtachandrashekhar Jun 9, 2024
4f1b412
workflow/webhook
mehtachandrashekhar Jun 9, 2024
1ef784f
workflow/webhook
mehtachandrashekhar Jun 9, 2024
6d01029
fix spacing
mehtachandrashekhar Jun 9, 2024
d2b41e5
added : shell bash
mehtachandrashekhar Jun 9, 2024
aeaebe6
added : shell bash
mehtachandrashekhar Jun 9, 2024
6c4d375
added : don't trigger
mehtachandrashekhar Jun 9, 2024
2f02c0f
removed:tokens
mehtachandrashekhar Jun 9, 2024
c328055
workflow/conditionals
mehtachandrashekhar Jun 9, 2024
7c4468f
workflow/conditionals
mehtachandrashekhar Jun 9, 2024
1d9c978
workflow/expression
mehtachandrashekhar Jun 9, 2024
9c2d24e
workflow/expression
mehtachandrashekhar Jun 9, 2024
27e472c
workflow/expression
mehtachandrashekhar Jun 9, 2024
af5a43a
workflow/expression
mehtachandrashekhar Jun 9, 2024
be88cfa
workflow/expression
mehtachandrashekhar Jun 9, 2024
5ad729e
workflow/expression
mehtachandrashekhar Jun 9, 2024
a385d43
workflow/expression
mehtachandrashekhar Jun 9, 2024
f11ff89
runner for mac/windows os
mehtachandrashekhar Jun 9, 2024
d21551f
workflow/commands
mehtachandrashekhar Jun 9, 2024
e6cd8b1
workflow/commands
mehtachandrashekhar Jun 9, 2024
d6ef051
Create label.yml
mehtachandrashekhar Jun 10, 2024
9bc1e2c
workflow/context.yml
mehtachandrashekhar Jun 10, 2024
929c042
workflow/jobs
mehtachandrashekhar Jun 10, 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
15 changes: 0 additions & 15 deletions .github/workflows/custom-action.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Jobs Examples"

on: ['push']

jobs:
job2:
runs-on: ubuntu-latest
needs: job1
steps:
- name: stepA
run: echo "Hello world"

job1:
runs-on: ubuntu-latest
steps:
- name: stepB
run: echo "Hello job 2"
22 changes: 22 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
14 changes: 14 additions & 0 deletions .github/workflows/workflow-command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "workflow-commands"

on: ['push']

jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: "group logging"
run: |
echo "::group:: My group message"
echo "Msg1"
echo "Msg2"
echo "::endgroup::"
6 changes: 3 additions & 3 deletions github-actions/Readme.me
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Manual Trigger

```sh
gh workflow run greet.yml -f name=mona -f greeting=hello -F data=@myfile.txt
echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json
gh workflow run manual.yml -f name=mona -f greeting=hello -F data=@data
echo '{"name":"mona", "greeting":"hello"}' | gh workflow run manual.yml --json
```

## Webhook Event
Expand All @@ -12,5 +12,5 @@ curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token {PAT} \
-d '{"event_type": "webhook", "client_payload": {"key": "value"} }' \
https://api.github.com/repos/{owner}/{repo}/dispatches
https://api.github.com/repos/mehtachandrashekhar/Github-Example/dispatches
```
1 change: 0 additions & 1 deletion github-actions/templates/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
issues: write
pull-requests: write
steps:
# https://github.com/actions/first-interaction
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 10 additions & 0 deletions github-actions/templates/schedule copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
schedule:
- cron: '*/5 * * * *'

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