From 19633940a4d9ceb501cc9fad4d05ca4f6b645767 Mon Sep 17 00:00:00 2001 From: "Chau Nguyen Developer (Christina)" Date: Sun, 27 Apr 2025 18:56:04 -0700 Subject: [PATCH 1/2] Update Notes.md. Added comments for workflow example --- Notes.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Notes.md b/Notes.md index 69a0711..c5d7cee 100644 --- a/Notes.md +++ b/Notes.md @@ -1,4 +1,31 @@ ## Notes * Workflows have jobs, and jobs have steps. * Each step consists of either a shell script that is executed, or a reference to an action that is run. When we talk about an action in this context, we mean a reusable unit of code. -* An action is a pre-defined, reusable set of jobs or code that perform specific tasks within a workflow. +* An action is a pre-defined, reusable set of jobs or code that perform specific tasks within a workflow. + +### Example of workflow +_//The name of this workflow_ +name: Post welcome comment +_//Trigger this workflow only when a PR is opened (not edited or closed)_ +on: + pull_request: + types: [opened] + _//The workflow needs write permissions to comment on pull requests._ + permissions: + pull-requests: write + _//Define a job called "build". The name could be anything. It is just a label._ + jobs: + build: + name: Post welcome comment + _//The runner (virtual machine) will be Ubuntu Linux._ + runs-on: ubuntu-latest + _//The steps inside the job._ + steps: + _//This step runs a command that posts a comment saying "Welcome to the repository!"_ + - run: gh pr comment $PR_URL --body "Welcome to the repository!" + _//The below setting sets environment variables_ + env: + _//A token that allows the GitHub CLI to authenticate_ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + _//The URL of the pull request that triggered the event._ + PR_URL: ${{ github.event.pull_request.html_url }} From 613d1abea09efb621f94c23fff329fce62b6395d Mon Sep 17 00:00:00 2001 From: "Chau Nguyen Developer (Christina)" Date: Sun, 27 Apr 2025 19:00:20 -0700 Subject: [PATCH 2/2] Update README.md. Added emoji on the first header. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92556f0..d674253 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-# Hello GitHub Actions +# Hello GitHub Actions 🎄🪴 _Create and run a GitHub Actions workflow._