From dfc5dea3b748fc5be43f9c7af6c826faa1c27e98 Mon Sep 17 00:00:00 2001 From: Maliksb11 <167416663+Maliksb11@users.noreply.github.com> Date: Sun, 22 Sep 2024 08:32:13 +0500 Subject: [PATCH] Initial commit --- .github/dependabot.yml | 6 + .github/steps/-step.txt | 1 + .github/steps/0-welcome.md | 1 + .github/steps/1-open-a-pull-request.md | 27 ++++ .github/steps/2-assign-yourself.md | 23 +++ .github/steps/3-leave-a-review.md | 40 +++++ .github/steps/4-suggest-changes.md | 25 +++ .github/steps/5-apply-changes.md | 18 +++ .github/steps/6-merge-your-pull-request.md | 17 ++ .github/steps/X-finish.md | 27 ++++ .github/workflows/0-welcome.yml | 97 +++++++++++ .github/workflows/1-open-a-pull-request.yml | 68 ++++++++ .github/workflows/2-assign-yourself.yml | 66 ++++++++ .github/workflows/3-leave-a-review.yml | 65 ++++++++ .github/workflows/4-suggest-changes.yml | 65 ++++++++ .github/workflows/5-apply-changes.yml | 65 ++++++++ .../workflows/6-merge-your-pull-request.yml | 64 ++++++++ .gitignore | 37 +++++ LICENSE | 7 + README.md | 77 +++++++++ index.html | 152 ++++++++++++++++++ 21 files changed, 948 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-open-a-pull-request.md create mode 100644 .github/steps/2-assign-yourself.md create mode 100644 .github/steps/3-leave-a-review.md create mode 100644 .github/steps/4-suggest-changes.md create mode 100644 .github/steps/5-apply-changes.md create mode 100644 .github/steps/6-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-open-a-pull-request.yml create mode 100644 .github/workflows/2-assign-yourself.yml create mode 100644 .github/workflows/3-leave-a-review.yml create mode 100644 .github/workflows/4-suggest-changes.yml create mode 100644 .github/workflows/5-apply-changes.yml create mode 100644 .github/workflows/6-merge-your-pull-request.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.html 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-open-a-pull-request.md b/.github/steps/1-open-a-pull-request.md new file mode 100644 index 0000000..c5db708 --- /dev/null +++ b/.github/steps/1-open-a-pull-request.md @@ -0,0 +1,27 @@ + + +## Step 1: Open a pull request + +_Welcome to "Review pull requests"! :wave:_ + +Let's get started by opening a pull request. + +**What is a pull request?**: Collaboration happens on a pull request. The pull request shows the changes in your branch to other people. This pull request is going to keep the changes you just made on your branch and propose applying them to the `main` branch. + +### :keyboard: Activity: Create a pull request + +1. Click on the **Pull requests** tab in your repository. +2. Click **New pull request**. +3. In the **base:** dropdown, make sure **main** is selected. +4. Select the **compare:** dropdown, and click `update-game`. +5. Click **Create pull request**. +6. Enter a title for your pull request: `Update the game over message`. +7. Enter a description for your pull request: `Update the game over message so people know how to play again!` +8. Click **Create pull request**. +9. 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/2-assign-yourself.md b/.github/steps/2-assign-yourself.md new file mode 100644 index 0000000..d34e77e --- /dev/null +++ b/.github/steps/2-assign-yourself.md @@ -0,0 +1,23 @@ + + +## Step 2: Assign yourself + +_Great job opening that pull request! :wave:_ + +**What is a _pull request review_?**: Reviewing a pull request is an opportunity to examine another contributor's changes and give them feedback. It's an awesome opportunity to learn more about how the project works and how others solve problems. + +The best way to get a review is to ask for one. On GitHub, you can ask someone to review a pull request by assigning them as a reviewer or assignee. If you are not ready for review, consider [creating a draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) instead. + +### :keyboard: Activity: Assign yourself + +1. Open the pull request you just created. +1. Under **Assignees** on the right side of the screen, add yourself. + + Because you created the pull request, you can't assign yourself as a reviewer, but feel free to assign a friend as a reviewer instead to see how it works :smile: + +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/3-leave-a-review.md b/.github/steps/3-leave-a-review.md new file mode 100644 index 0000000..5a79599 --- /dev/null +++ b/.github/steps/3-leave-a-review.md @@ -0,0 +1,40 @@ + + +## Step 3: Leave a review + +_You assigned yourself! :tada:_ + +Pull request reviews ensure quality and maintain momentum of changes to your project. + +#### When reviewing a pull request: + +1. Review the _title_ and _body_ of the pull request, and possibly any associated issue, to understand the intended change. +1. Review the [diff](https://docs.github.com/en/get-started/quickstart/github-glossary#diff), the comparison of the proposed code, in the context of the whole project. +1. For most things, try out the proposed change. Check if the actual change matches the intention. Find the repository's [contributing guide](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors) to find out how to review the changes. + +#### In your review comments: + +- Identify potential issues, risks, and limitations. +- Suggest changes and improvements. +- Share awareness of upcoming changes that the pull request doesn't account for. +- Ask questions to verify shared understanding. +- Highlight what the author did well and should keep doing. +- Prioritize the most important feedback. +- Be concise _and_ provide meaningful detail. +- Treat the pull request author with kindness and empathy. + +When an approval or request for changes is not yet needed, consider using **comments**. An **approval** lets the author know you believe the pull request is safe to merge. **Requesting changes** lets the author know you believe the pull request is not ready to merge. + +### :keyboard: Activity: Leave a review + +1. On the pull request, click **Files changed**. +1. Click **Review changes**. +1. Add a comment with your initial thoughts on the pull request. +1. Select _comment_. You won't be able to _approve_ or _request changes_ to your own pull request. +1. Click **Submit review**. +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-suggest-changes.md b/.github/steps/4-suggest-changes.md new file mode 100644 index 0000000..0ca4997 --- /dev/null +++ b/.github/steps/4-suggest-changes.md @@ -0,0 +1,25 @@ + + +## Step 4: Suggest changes + +_Nice work reviewing that pull request :sparkles:_ + +Now that you have explored the different ways you can review a pull request it is time to learn how to use _suggest changes_. + +**What is _suggest changes_?**: This feature enables you to recommend a change to a pull request that the author can commit with the push of a button. + +### :keyboard: Activity: Suggest changes + +1. On the pull request, click **Files changed**. +1. Find the `index.html` changes. +1. Hover your cursor next to the line numbers on the left side of the page. +1. Click the blue plus icon. +1. After the comment form appears, click the **Add a suggestion** button.
+ ![add-a-suggestion-button](https://user-images.githubusercontent.com/97056108/184449714-61e8ee51-824a-48c1-9436-2dfd67f2c070.png) +1. Edit the suggestion. +1. Click **Add a single comment**. +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-apply-changes.md b/.github/steps/5-apply-changes.md new file mode 100644 index 0000000..920b9aa --- /dev/null +++ b/.github/steps/5-apply-changes.md @@ -0,0 +1,18 @@ + + +## Step 5: Apply suggested changes + +_Nicely done suggesting changes! :partying_face:_ + +Now let's see how easy it is to [apply your suggestion](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request). + +### :keyboard: Activity: Apply suggested changes + +1. Click **Commit suggestion**. +1. Type a commit message. +1. Click **Commit 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/6-merge-your-pull-request.md b/.github/steps/6-merge-your-pull-request.md new file mode 100644 index 0000000..78706aa --- /dev/null +++ b/.github/steps/6-merge-your-pull-request.md @@ -0,0 +1,17 @@ + + +## Step 6: Merge your pull request + +_Almost there! :heart:_ + +You can now [merge](https://docs.github.com/en/get-started/quickstart/github-glossary#merge) your pull request! + +### :keyboard: Activity: Merge your pull request + +1. Click **Merge pull request**. +1. Delete the branch `update-game` (optional). +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..49d4b33 --- /dev/null +++ b/.github/steps/X-finish.md @@ -0,0 +1,27 @@ + + +## Finish + +_Congratulations friend, you've completed this course!_ + +celebrate + +As you continue working on GitHub, remember that high quality reviews improve your projects. If you are new to a repository, inquire about what review practices they have so you can hit the ground running. + +Here's a recap of all the tasks you've accomplished in your repository: + +- You learned how to assign pull requests for review. +- You left a review on a pull request. +- You suggested changes to a pull request. +- You applied suggested changes to a pull request. + +### What's next? + +- Try adding a [`CODEOWNERS`](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) file to your project to automatically assign reviewers to pull requests. +- We'd love to hear what you thought of this course [in our discussion board](https://github.com/orgs/skills/discussions/categories/review-pull-requests). +- [Take another GitHub Skills course](https://github.com/skills). +- [Read the GitHub Getting Started docs](https://docs.github.com/en/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..4f1d935 --- /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. + + # Create update-game branch, update game, and create pull request for the learner. + - name: Prepare a branch and pull request + 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=update-game + git checkout -b $BRANCH + + echo "Update index.html" + sed -i.bak 's/Game over/Game over, refresh to play again 🧑‍💻 🤖!/' index.html + + 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.html + git commit --message="Update game over message" + + 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: update-game diff --git a/.github/workflows/1-open-a-pull-request.yml b/.github/workflows/1-open-a-pull-request.yml new file mode 100644 index 0000000..f4cb16e --- /dev/null +++ b/.github/workflows/1-open-a-pull-request.yml @@ -0,0 +1,68 @@ +name: Step 1, Open a pull request + +# This step listens for the learner to open a pull request with branch `update-game`. +# This workflow updates from step 1 to step 2. + +# This will run every time we create a branch or tag. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + pull_request: + types: + - opened + - reopened + +# 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_open_a_pull_request: + name: On open a pull request + 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. + # 3. The head branch name is `update-game`. + # 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 + && github.head_ref == 'update-game' }} + + # 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. + ref: update-game # Important, as normally `pull_request` event won't grab other branches. + + # In README.md, switch step 1 for step 2. + - name: Update to step 2 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 1 + to_step: 2 + branch_name: update-game diff --git a/.github/workflows/2-assign-yourself.yml b/.github/workflows/2-assign-yourself.yml new file mode 100644 index 0000000..c72b211 --- /dev/null +++ b/.github/workflows/2-assign-yourself.yml @@ -0,0 +1,66 @@ +name: Step 2, Assign yourself + +# This step triggers after the user assigns themselves as a pull request reviewer. +# This workflow updates from step 2 to step 3. + +# This will run every time someone is assigned as a pull request reviewer. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + pull_request: + types: + - assigned + - review_requested + +# 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_assigned_reviewer: + name: On assigned reviewer + 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. + ref: update-game + + # 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: update-game diff --git a/.github/workflows/3-leave-a-review.yml b/.github/workflows/3-leave-a-review.yml new file mode 100644 index 0000000..aecbb25 --- /dev/null +++ b/.github/workflows/3-leave-a-review.yml @@ -0,0 +1,65 @@ +name: Step 3, Leave a review + +# This step triggers after the user leaves a pull request review. +# This workflow updates from step 3 to step 4. + +# This will run every time we leave a pull request review. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + pull_request_review: + types: + - submitted + +# 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_leave_review: + name: On leave review + 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. + ref: update-game + + # 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: update-game diff --git a/.github/workflows/4-suggest-changes.yml b/.github/workflows/4-suggest-changes.yml new file mode 100644 index 0000000..6997df8 --- /dev/null +++ b/.github/workflows/4-suggest-changes.yml @@ -0,0 +1,65 @@ +name: Step 4, Suggest changes + +# This step triggers after the user leaves a review comment. +# This workflow updates from step 4 to step 5. + +# This will run every time we leave a review comment. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + pull_request_review_comment: + types: + - created + +# 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_review_comment: + name: On review comment + 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. + ref: update-game + + # 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: update-game diff --git a/.github/workflows/5-apply-changes.yml b/.github/workflows/5-apply-changes.yml new file mode 100644 index 0000000..26bedee --- /dev/null +++ b/.github/workflows/5-apply-changes.yml @@ -0,0 +1,65 @@ +name: Step 5, Apply changes + +# This step triggers after the user applies the pull request suggested change. +# This workflow updates from step 5 to step 6. + +# This will run every time we push to the `update-game branch`. +# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows +on: + workflow_dispatch: + push: + branches: + - update-game + +# 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_apply_suggested_change: + name: On apply suggested change + 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. + ref: update-game + + # In README.md, switch step 5 for step 6. + - name: Update to step 6 + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 5 + to_step: 6 + branch_name: update-game diff --git a/.github/workflows/6-merge-your-pull-request.yml b/.github/workflows/6-merge-your-pull-request.yml new file mode 100644 index 0000000..142127e --- /dev/null +++ b/.github/workflows/6-merge-your-pull-request.yml @@ -0,0 +1,64 @@ +name: Step 6, Merge your pull request + +# This step triggers after a pull requst is merged to `main`. +# This workflow updates from step 6 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 6. + # 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 == 6 }} + + # 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 6 for step X. + - name: Update to step X + uses: skills/action-update-step@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + from_step: 6 + to_step: X + branch_name: update-game 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..4ea4ec5 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +
+ + + +# Review pull requests + +_Collaborate and work together on GitHub._ + +
+ + + +## Welcome + +All great projects start with collaboration. Pull requests are the foundation of teamwork on GitHub — and pull request reviews give you the ability to work together and discuss changes specific to a pull request by commenting, requesting changes, or approving. + +- **Who is this for**: Developers, new GitHub users, users new to Git, students, managers, teams. +- **What you'll learn**: When and how to request a review; how to provide a review of someone else's pull request. +- **What you'll build**: We'll be reviewing a pull request for a simple game. +- **Prerequisites**: We assume you are familiar with creating branches, commits, and pull requests—you can learn this in our [Introduction to GitHub](https://github.com/skills/introduction-to-github) course. +- **How long**: This course takes less than 30 minutes to complete. + +In this course, you will: + +1. Open a pull request +2. Assign yourself +3. Leave a review +4. Suggest changes +5. Apply changes +6. Merge your pull request + +### How to start this course + + + +[![start-course](https://user-images.githubusercontent.com/1221423/235727646-4a590299-ffe5-480d-8cd5-8194ea184546.svg)](https://github.com/new?template_owner=skills&template_name=review-pull-requests&owner=%40me&name=skills-review-pull-requests&description=My+clone+repository&visibility=public) + +1. Right-click **Start course** and open the link in a new tab. +2. In the new tab, most of the prompts will automatically fill in for you. + - For owner, choose your personal account or an organization to host the repository. + - We recommend creating a public repository, as private repositories will [use Actions minutes](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions). + - Scroll down and click the **Create repository** button at the bottom of the form. +3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README. + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..2485e1a --- /dev/null +++ b/index.html @@ -0,0 +1,152 @@ +Tic Tac Toe + + + + +

Tic Tac Toe

+ + + + + + + + + + + + + + + + + +
+ + + +