From b38fd7b765a3025568401b28c620d6162d78c52e Mon Sep 17 00:00:00 2001 From: Rahul <66193581+rahul9852-dot@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:46:12 +0530 Subject: [PATCH 1/5] Create greetings.yml --- .github/workflows/greetings.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 000000000..46774343e --- /dev/null +++ b/.github/workflows/greetings.yml @@ -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" From 9a494a2ad6af58da362e9e0dd88c353af9961fd9 Mon Sep 17 00:00:00 2001 From: Rahul <66193581+rahul9852-dot@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:35:56 +0000 Subject: [PATCH 2/5] my mannual-trigger --- {github-actions/templates => .github}/greetings.yml | 0 {github-actions/templates => .github/workflows}/manual.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {github-actions/templates => .github}/greetings.yml (100%) rename {github-actions/templates => .github/workflows}/manual.yml (100%) diff --git a/github-actions/templates/greetings.yml b/.github/greetings.yml similarity index 100% rename from github-actions/templates/greetings.yml rename to .github/greetings.yml diff --git a/github-actions/templates/manual.yml b/.github/workflows/manual.yml similarity index 100% rename from github-actions/templates/manual.yml rename to .github/workflows/manual.yml From a650e76f24bf5525f15fe0e032e84cf2d94c5919 Mon Sep 17 00:00:00 2001 From: Rahul <66193581+rahul9852-dot@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:12:10 +0000 Subject: [PATCH 3/5] add webhook --- .github/workflows/webhook.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/webhook.yml diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml new file mode 100644 index 000000000..dbdf1e47d --- /dev/null +++ b/.github/workflows/webhook.yml @@ -0,0 +1,15 @@ +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" From a23fca2e3bebfb49615cbfc7249fdc0432c647c9 Mon Sep 17 00:00:00 2001 From: Rahul <66193581+rahul9852-dot@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:16:53 +0000 Subject: [PATCH 4/5] add comma --- .github/workflows/webhook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index dbdf1e47d..b200d991f 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -9,7 +9,7 @@ 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" From d87799de3a885d3e6f89ec64c2d446451404d24d Mon Sep 17 00:00:00 2001 From: Rahul <66193581+rahul9852-dot@users.noreply.github.com> Date: Thu, 12 Sep 2024 19:04:38 +0530 Subject: [PATCH 5/5] add conditions --- .github/workflows/conditional.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/conditional.yml diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml new file mode 100644 index 000000000..87b48c2f9 --- /dev/null +++ b/.github/workflows/conditional.yml @@ -0,0 +1,14 @@ +name: example-workflow +on: [push] +jobs: + hello-world: + if: github.repository == 'octo-org/octo-repo-prod' + 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!" \ No newline at end of file