From d63a9ba03bc453fe2e33075aab8be19af2fe8f2f Mon Sep 17 00:00:00 2001 From: Hariharan Thavachelvam <164553783+thavaahariharangit@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:53:10 +0100 Subject: [PATCH] Initial commit --- .github/dependabot.yml | 6 ++ .github/steps/-step.txt | 1 + .github/steps/0-welcome.md | 1 + .github/steps/1-add-headers.md | 51 ++++++++++ .github/steps/2-add-an-image.md | 29 ++++++ .github/steps/3-add-a-code-example.md | 49 ++++++++++ .github/steps/4-make-a-task-list.md | 44 +++++++++ .github/steps/5-merge-your-pull-request.md | 16 +++ .github/steps/X-finish.md | 30 ++++++ .github/workflows/0-welcome.yml | 97 +++++++++++++++++++ .github/workflows/1-add-headers.yml | 71 ++++++++++++++ .github/workflows/2-add-an-image.yml | 71 ++++++++++++++ .github/workflows/3-add-a-code-example.yml | 71 ++++++++++++++ .github/workflows/4-make-a-task-list.yml | 71 ++++++++++++++ .../workflows/5-merge-your-pull-request.yml | 64 ++++++++++++ .gitignore | 37 +++++++ LICENSE | 7 ++ README.md | 75 ++++++++++++++ 18 files changed, 791 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/steps/-step.txt create mode 100644 .github/steps/0-welcome.md create mode 100644 .github/steps/1-add-headers.md create mode 100644 .github/steps/2-add-an-image.md create mode 100644 .github/steps/3-add-a-code-example.md create mode 100644 .github/steps/4-make-a-task-list.md create mode 100644 .github/steps/5-merge-your-pull-request.md create mode 100644 .github/steps/X-finish.md create mode 100644 .github/workflows/0-welcome.yml create mode 100644 .github/workflows/1-add-headers.yml create mode 100644 .github/workflows/2-add-an-image.yml create mode 100644 .github/workflows/3-add-a-code-example.yml create mode 100644 .github/workflows/4-make-a-task-list.yml create mode 100644 .github/workflows/5-merge-your-pull-request.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8ac6b8c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/steps/-step.txt b/.github/steps/-step.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/.github/steps/-step.txt @@ -0,0 +1 @@ +0 diff --git a/.github/steps/0-welcome.md b/.github/steps/0-welcome.md new file mode 100644 index 0000000..9ff13a5 --- /dev/null +++ b/.github/steps/0-welcome.md @@ -0,0 +1 @@ + diff --git a/.github/steps/1-add-headers.md b/.github/steps/1-add-headers.md new file mode 100644 index 0000000..d629bab --- /dev/null +++ b/.github/steps/1-add-headers.md @@ -0,0 +1,51 @@ + + +## Step 1: Add headers + +_Welcome to "Communicate using Markdown"! :wave:_ + +**What is _Markdown_?** Markdown is a [lightweight syntax](https://docs.github.com/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for communicating on GitHub. You can format text to add a heading, lists, **bold**, _italics_, tables, and many other stylings. You can use Markdown in most places around GitHub: + +- Comments on [issues](https://docs.github.com/issues/tracking-your-work-with-issues/about-issues), [pull requests](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests), and [discussions](https://docs.github.com/discussions/collaborating-with-your-community-using-discussions/about-discussions) +- Files with the `.md` or `.markdown` extension +- Sharing snippets of text in [Gists](https://docs.github.com/github/writing-on-github/editing-and-sharing-content-with-gists/creating-gists) + +**What is a _header_?** A header is a larger bit of text at the beginning of a section. There are six sizes. + +### Example + +```md +# This is an `
+``` +$ git init +Initialized empty Git repository in /Users/skills/Projects/recipe-repository/.git/ +``` ++ +#### How it looks + +``` +$ git init +Initialized empty Git repository in /Users/skills/Projects/recipe-repository/.git/ +``` + +### Example 2 + +
+``` javascript +var myVar = "Hello, world!"; +``` ++ +#### How it looks + +```javascript +var myVar = "Hello, world!"; +``` + +### :keyboard: Activity: Adding a code example + +1. As you did before, edit the file in this pull request. +1. In the file, add the correct Markdown for a code example of your choice. +1. Use the **Preview** tab to check your Markdown formatting. +1. Commit your changes. +1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step. diff --git a/.github/steps/4-make-a-task-list.md b/.github/steps/4-make-a-task-list.md new file mode 100644 index 0000000..f8b80f5 --- /dev/null +++ b/.github/steps/4-make-a-task-list.md @@ -0,0 +1,44 @@ + + +## Step 4: Make a task list + +_Great job adding a code example to the file :partying_face:_ + +**What is a _task list_?** A task list creates checkboxes to check off. They're very useful for tracking issues and pull requests. If you include a task list in the body of an issue or pull request, you'll see a progress indicator in your issue list. The syntax for task lists is very specific. Be sure to include the spaces where required, or else they won't render. + +### Example + +``` +- [x] List syntax is required +- [x] This item is complete +- [ ] This item is not complete +``` + +#### How it looks + +- [x] List syntax is required +- [x] This item is complete +- [ ] This item is not complete + +### :keyboard: Activity: Add a task list + +GitHub Actions went ahead and made a branch for you. So you'll need to add to the file we've created in the branch, and we will check your work as you work through this course! + +1. Return to your pull request. +1. Use Markdown to create a task list. Here is an example: + + ```md + - [ ] Turn on GitHub Pages + - [ ] Outline my portfolio + - [ ] Introduce myself to the world + ``` + + Remember, a task list starts with the syntax `- [ ]` and then the task list item. The formatting is specific! + +1. Use the **Preview** tab to check your Markdown formatting. +1. Commit the changes to the file. +1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step. diff --git a/.github/steps/5-merge-your-pull-request.md b/.github/steps/5-merge-your-pull-request.md new file mode 100644 index 0000000..cf1592a --- /dev/null +++ b/.github/steps/5-merge-your-pull-request.md @@ -0,0 +1,16 @@ + + +## Step 5: Merge your pull request + +_Great job adding a task list to the file :heart:_ + +You can now [merge](https://docs.github.com/get-started/quickstart/github-glossary#merge) your pull request! + +### :keyboard: Activity: Merge your pull request + +1. Click **Merge pull request**. +1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step. diff --git a/.github/steps/X-finish.md b/.github/steps/X-finish.md new file mode 100644 index 0000000..0356b83 --- /dev/null +++ b/.github/steps/X-finish.md @@ -0,0 +1,30 @@ + + +## Finish + +_Congratulations friend, you've completed this course!_ + + + +Here's a recap of all the tasks you've accomplished in your repository: + +1. You learned about Markdown, headings, images, code examples, and task lists. +1. You created and merged a Markdown file. +1. You learned an essential GitHub skill. 🎉 + +### What's next? + +- You can enable GitHub Pages and see your Markdown file as a website! + 1. Under your repository name at the upper right, click :gear: **Settings**. + 1. Then on the lower left, click **Pages** in the **Code and automation** section. + 1. In the **GitHub Pages** section, ensure "Deploy from a branch" is selected from the **Source** drop-down menu, and then select `main` from the **Branch** drop-down menu as your GitHub Pages publishing source. + 1. Click the **Save** button. + 1. Wait about 30 seconds then refresh the page. When you see "Your site is published at ..." you can click on the link to see your published site. +- Learn more about [Markdown](https://docs.github.com/github/writing-on-github). +- We'd love to hear what you thought of this course [in our discussion board](https://github.com/orgs/skills/discussions/categories/communicate-using-markdown) +- [Take another GitHub Skills course](https://github.com/skills). +- [Read the GitHub Getting Started docs](https://docs.github.com/get-started). +- To find projects to contribute to, check out [GitHub Explore](https://github.com/explore). diff --git a/.github/workflows/0-welcome.yml b/.github/workflows/0-welcome.yml new file mode 100644 index 0000000..7dce0a7 --- /dev/null +++ b/.github/workflows/0-welcome.yml @@ -0,0 +1,97 @@ +name: Step 0, Welcome + +# This step triggers after the learner creates a new repository from the template. +# This workflow updates from step 0 to step 1. + +# This will run every time we create push a commit to `main`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - main + +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication +permissions: + # Need `contents: read` to checkout the repository. + # Need `contents: write` to update the step metadata. + # Need `pull-requests: write` to create a pull request. + contents: write + pull-requests: write + +jobs: + # Get the current step to only run the main job when the learner is on the same step. + get_current_step: + name: Check current step number + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: get_step + run: | + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_start: + name: On start + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 0. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 0 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # Make a branch, file, commit, and pull request for the learner. + - name: Prepare a pull request, branch, and file + run: | + echo "Make sure we are on step 0" + if [ "$(cat .github/steps/-step.txt)" != 0 ] + then + echo "Current step is not 0" + exit 0 + fi + + echo "Make a branch" + BRANCH=start-markdown + git checkout -b $BRANCH + + echo "Make a file" + touch index.md + + echo "Make a commit" + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git add index.md + git commit --message="Create index.md file" + + echo "Push" + git push --set-upstream origin $BRANCH + + echo "Restore main" + git checkout main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # In README.md, switch step 0 for step 1. + - name: Update to step 1 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 0 + to_step: 1 + branch_name: start-markdown diff --git a/.github/workflows/1-add-headers.yml b/.github/workflows/1-add-headers.yml new file mode 100644 index 0000000..e25784a --- /dev/null +++ b/.github/workflows/1-add-headers.yml @@ -0,0 +1,71 @@ +name: Step 1, Add headers + +# This step triggers after a commit on the branch `start-markdown`. +# This workflow updates from step 1 to step 2. + +# This will run every time we create push a commit to `start-markdown`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - start-markdown + +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication +permissions: + # Need `contents: read` to checkout the repository. + # Need `contents: write` to update the step metadata. + contents: write + +jobs: + # Get the current step to only run the main job when the learner is on the same step. + get_current_step: + name: Check current step number + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: get_step + run: | + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_commit_start_markdown_headers: + name: On commit, start markdown, headers + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 1. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 1 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # Check that there is at least one header in the markdown file. + - name: Check markdown syntax, header + uses: skills/action-check-file@v1 + with: + file: "index.md" + search: "(?> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_commit_start_markdown_image: + name: On commit, start markdown, image + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 2. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 2 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # Check that there is at least one image in the markdown file. + - name: Check markdown syntax, image + uses: skills/action-check-file@v1 + with: + file: "index.md" + search: "\\!\\[.*\\]\\(.*\\)" + + # In README.md, switch step 2 for step 3. + - name: Update to step 3 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 2 + to_step: 3 + branch_name: start-markdown diff --git a/.github/workflows/3-add-a-code-example.yml b/.github/workflows/3-add-a-code-example.yml new file mode 100644 index 0000000..0099c96 --- /dev/null +++ b/.github/workflows/3-add-a-code-example.yml @@ -0,0 +1,71 @@ +name: Step 3, Add a code example + +# This step triggers after a commit on the branch `start-markdown`. +# This workflow updates from step 3 to step 4. + +# This will run every time we create push a commit to `start-markdown`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - start-markdown + +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication +permissions: + # Need `contents: read` to checkout the repository. + # Need `contents: write` to update the step metadata. + contents: write + +jobs: + # Get the current step to only run the main job when the learner is on the same step. + get_current_step: + name: Check current step number + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: get_step + run: | + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_commit_start_markdown_code_example: + name: On commit, start markdown, code example + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 3. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 3 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # Check that there is at least one code example in the markdown file. + - name: Check markdown syntax, code example + uses: skills/action-check-file@v1 + with: + file: "index.md" + search: "```" + + # In README.md, switch step 3 for step 4. + - name: Update to step 4 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 3 + to_step: 4 + branch_name: start-markdown diff --git a/.github/workflows/4-make-a-task-list.yml b/.github/workflows/4-make-a-task-list.yml new file mode 100644 index 0000000..9a207b0 --- /dev/null +++ b/.github/workflows/4-make-a-task-list.yml @@ -0,0 +1,71 @@ +name: Step 4, Make a task list + +# This step triggers after a commit on the branch `start-markdown`. +# This workflow updates from step 4 to step 5. + +# This will run every time we create push a commit to `start-markdown`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - start-markdown + +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication +permissions: + # Need `contents: read` to checkout the repository. + # Need `contents: write` to update the step metadata. + contents: write + +jobs: + # Get the current step to only run the main job when the learner is on the same step. + get_current_step: + name: Check current step number + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: get_step + run: | + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_commit_start_markdown_task_list: + name: On commit, start markdown, task list + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 4. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 4 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # Make sure there is at least one task list item in the file. + - name: Check markdown syntax, task list + uses: skills/action-check-file@v1 + with: + file: "index.md" + search: "([\\-\\+\\*]|[0-9]+\\.)[\ \\t]+\\[[\ \\t\\fxX]\\][\ \\t\\f]+\\S.*$" + + # In README.md, switch step 4 for step 5. + - name: Update to step 5 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 4 + to_step: 5 + branch_name: start-markdown diff --git a/.github/workflows/5-merge-your-pull-request.yml b/.github/workflows/5-merge-your-pull-request.yml new file mode 100644 index 0000000..4ce793c --- /dev/null +++ b/.github/workflows/5-merge-your-pull-request.yml @@ -0,0 +1,64 @@ +name: Step 5, Merge your pull request + +# This step triggers after a pull requst is merged to `main`. +# This workflow updates from step 5 to step X. + +# This will run every time we create push a commit to `main`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - main + +# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication +permissions: + # Need `contents: read` to checkout the repository. + # Need `contents: write` to update the step metadata. + contents: write + +jobs: + # Get the current step to only run the main job when the learner is on the same step. + get_current_step: + name: Check current step number + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: get_step + run: | + echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT + outputs: + current_step: ${{ steps.get_step.outputs.current_step }} + + on_merge: + name: On merge + needs: get_current_step + + # We will only run this action when: + # 1. This repository isn't the template repository. + # 2. The step is currently 5. + # Reference: https://docs.github.com/en/actions/learn-github-actions/contexts + # Reference: https://docs.github.com/en/actions/learn-github-actions/expressions + if: >- + ${{ !github.event.repository.is_template + && needs.get_current_step.outputs.current_step == 5 }} + + # We'll run Ubuntu for performance instead of Mac or Windows. + runs-on: ubuntu-latest + + steps: + # We'll need to check out the repository so that we can edit the README. + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Let's get all the branches. + + # In README.md, switch step 5 for step X. + - name: Update to step X + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 5 + to_step: X + branch_name: start-markdown diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..773bfd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so + +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c5bc3d --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b54d8cc --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +