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

Create greetings.yml #100

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion .github/workflows/custom-action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: 'custom-action.yml'
on: [push]

jobs:
Expand All @@ -12,4 +13,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 }}"
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:
build:
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
21 changes: 21 additions & 0 deletions .github/workflows/multi-event-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'multi-event-trigger.yml'

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"
echo "Action: $GITHUB_ACTION"
echo "Actor: $GITHUB_ACTOR"
12 changes: 12 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'schedule.yml'

on:
schedule:
- cron: '*/2 * * * *'

jobs:
hello_world:
runs-on: ubuntu-latest
steps:
- name: Echo current time
run: echo "The current server time is $(date)"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Github-Examples
A repo containing GitHub for programmatic examples
# 1) Change and commit/push to readme.md to trigger "multi-event" action for push event into main or dev branch