diff --git a/.github/steps/-step.txt b/.github/steps/-step.txt index 573541a..00750ed 100644 --- a/.github/steps/-step.txt +++ b/.github/steps/-step.txt @@ -1 +1 @@ -0 +3 diff --git a/.github/workflows/classroom.yml b/.github/workflows/classroom.yml new file mode 100644 index 0000000..162159b --- /dev/null +++ b/.github/workflows/classroom.yml @@ -0,0 +1,64 @@ +name: Autograding Tests +'on': +- workflow_dispatch +- repository_dispatch +permissions: + checks: write + actions: read + contents: read +jobs: + run-autograding-tests: + runs-on: ubuntu-latest + if: github.actor != 'github-classroom[bot]' + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Step 1 Create a Branch + id: step-1-create-a-branch + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 1 Create a Branch + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 1 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 2 Commit a File + id: step-2-commit-a-file + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 2 Commit a File + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 2 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 3 Open a Pull Request + id: step-3-open-a-pull-request + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 3 Open a Pull Request + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 3 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Step 4 Merge Your Pull Request + id: step-4-merge-your-pull-request + uses: classroom-resources/autograding-command-grader@v1 + with: + test-name: Step 4 Merge Your Pull Request + setup-command: sleep 20 + command: "[ $(cat .github/steps/-step.txt) -ge 4 ] || [ $(cat .github/steps/-step.txt) + = X ]" + timeout: 10 + max-score: 1 + - name: Autograding Reporter + uses: classroom-resources/autograding-grading-reporter@v1 + env: + STEP-1-CREATE-A-BRANCH_RESULTS: "${{steps.step-1-create-a-branch.outputs.result}}" + STEP-2-COMMIT-A-FILE_RESULTS: "${{steps.step-2-commit-a-file.outputs.result}}" + STEP-3-OPEN-A-PULL-REQUEST_RESULTS: "${{steps.step-3-open-a-pull-request.outputs.result}}" + STEP-4-MERGE-YOUR-PULL-REQUEST_RESULTS: "${{steps.step-4-merge-your-pull-request.outputs.result}}" + with: + runners: step-1-create-a-branch,step-2-commit-a-file,step-3-open-a-pull-request,step-4-merge-your-pull-request diff --git a/PROFILE.md b/PROFILE.md new file mode 100644 index 0000000..3a3a760 --- /dev/null +++ b/PROFILE.md @@ -0,0 +1 @@ +Welcome to my GitHub profile! diff --git a/README.md b/README.md index 9d971b5..bd32c6e 100644 --- a/README.md +++ b/README.md @@ -14,29 +14,48 @@ _Get started using GitHub in less than an hour._ -## Welcome +## Step 3: Open a pull request -People use GitHub to build some of the most advanced technologies in the world. Whether you’re visualizing data or building a new game, there’s a whole community and set of tools on GitHub that can help you do it even better. GitHub Skills’ “Introduction to GitHub” course guides you through everything you need to start contributing in less than an hour. +_Nice work making that commit! :sparkles:_ -- **Who is this for**: New developers, new GitHub users, and students. -- **What you'll learn**: We'll introduce repositories, branches, commits, and pull requests. -- **What you'll build**: We'll make a short Markdown file you can use as your [profile README](https://docs.github.com/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme). -- **Prerequisites**: None. This course is a great introduction for your first day on GitHub. -- **How long**: This course takes less than one hour to complete. +Now that you have made a change to the project and created a commit, it’s time to share your proposed change through a pull request! -In this course, you will: +**What is a pull request?**: Collaboration happens on a _[pull request](https://docs.github.com/en/get-started/quickstart/github-glossary#pull-request)_. The pull request shows the changes in your branch to other people and allows people to accept, reject, or suggest additional changes to your branch. In a side by side comparison, this pull request is going to keep the changes you just made on your branch and propose applying them to the `main` project branch. For more information about pull requests, see "[About pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)". -1. Create a branch -2. Commit a file -3. Open a pull request -4. Merge your pull request +### :keyboard: Activity: Create a pull request -Wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in this assignment repository's README. +You may have noticed after your commit that a message displayed indicating your recent push to your branch and providing a button that says **Compare & pull request**. + +![screenshot of message and button](/images/compare-and-pull-request.png) + +To create a pull request automatically, click **Compare & pull request**, and then skip to step 6 below. If you don't click the button, the instructions below walk you through manually setting up the pull request. + +1. Click on the **Pull requests** tab in the header menu of your repository. +2. Click **New pull request**. +3. In the **base:** dropdown, make sure **main** is selected. +4. Select the **compare:** dropdown, and click `my-first-branch`. + + screenshot showing both branch selections + +5. Click **Create pull request**. +6. Enter a title for your pull request. By default, the title will automatically be the name of your branch. For this exercise, let's edit the field to say `Add my first file`. +7. The next field helps you provide a description of the changes you made. Here, you can add a description of what you’ve accomplished so far. As a reminder, you have: created a new branch, created a file, and made a commit. + + screenshot showing pull request + +8. Click **Create pull request**. You will automatically be navigated to your new 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. + + **Note**: You may see evidence of GitHub Actions running on the tab with the pull request opened! The image below shows a line you might see on your pull request after the Action finishes running. + + screenshot of an example of an actions line