Skip to content

Commit 380cd3d

Browse files
committed
updated exercise to put proper step1 for resolve merge conflict
1 parent 67fde5c commit 380cd3d

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

.github/workflows/0-start-exercise.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
name: Start Exercise
2121
uses: skills/exercise-toolkit/.github/workflows/[email protected]
2222
with:
23-
exercise-title: "Review Pull Requests"
24-
intro-message: "Let's learn to collaborate with others using pull requests."
23+
exercise-title: "Resolve Merge Conflicts"
24+
intro-message: "Let's learn how to resolve merge conflicts when collaborating on GitHub."
2525

26-
modify_repo_content:
27-
name: Modify repo content
26+
prepare_merge_conflict:
27+
name: Prepare merge conflict
2828
runs-on: ubuntu-latest
2929
needs: [start_exercise]
3030
env:
@@ -33,25 +33,24 @@ jobs:
3333
steps:
3434
- name: Checkout
3535
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
3638

37-
- name: Prepare a branch and pull request
39+
- name: Simulate conflict between main and my-resume
3840
run: |
39-
40-
echo "Make a branch"
41-
BRANCH=update-game
42-
git checkout -b $BRANCH
43-
44-
echo "Update index.html"
45-
sed -i.bak 's/Game over/Game over, refresh to play again 🧑‍💻 🤖!/' index.html
46-
47-
echo "Make a commit"
41+
git checkout -b my-resume
4842
git config user.name github-actions[bot]
4943
git config user.email github-actions[bot]@users.noreply.github.com
50-
git add index.html index.html.bak
51-
git commit --message="Update game over message"
52-
53-
echo "Push"
54-
git push --set-upstream origin $BRANCH
44+
sed -i 's/1/2/' .github/steps/-step.txt
45+
git add .github/steps/-step.txt
46+
git commit -m "Update step in my-resume"
47+
git push origin my-resume
48+
49+
git checkout main
50+
sed -i 's/Experience/Jobs/' resume.md
51+
git add resume.md
52+
git commit -m "Update resume.md in main"
53+
git push origin main
5554
env:
5655
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5756

@@ -73,22 +72,12 @@ jobs:
7372
path: exercise-toolkit
7473
ref: v0.5.0
7574

76-
- name: Build comment - add step content
77-
id: build-comment
78-
uses: skills/action-text-variables@v2
79-
with:
80-
template-file: ${{ env.STEP_1_FILE }}
81-
template-vars: |
82-
login: ${{ github.actor }}
83-
full_repo_name: ${{ github.repository }}
84-
8575
- name: Create comment - add step content
8676
run: |
8777
gh issue comment "$ISSUE_URL" \
88-
--body "$ISSUE_BODY"
78+
--body-file "$STEP_1_FILE"
8979
env:
9080
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }}
9281

9382
- name: Create comment - watching for progress
9483
run: |

0 commit comments

Comments
 (0)