Skip to content

Commit b516d01

Browse files
committed
using the depth
1 parent 2619d0a commit b516d01

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/2-resolve-a-merge-conflict.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
contents: write
1111
actions: write
1212
issues: write
13+
pull-requests: write
1314

1415
env:
1516
STEP_3_FILE: ".github/steps/3-create-your-own-conflict.md"
@@ -29,13 +30,34 @@ jobs:
2930
steps:
3031
- name: Checkout
3132
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
ref: main # ensure base branch context
3236

3337
- name: Get response templates
3438
uses: actions/checkout@v4
3539
with:
3640
repository: skills/exercise-toolkit
3741
path: exercise-toolkit
3842
ref: v0.5.0
43+
44+
- name: Create and push a new file on main
45+
run: |
46+
set -e
47+
48+
echo "Create new file"
49+
printf "# References\n\n* octocat 1 😈" > references.md
50+
51+
echo "Commit file"
52+
git config user.name github-actions[bot]
53+
git config user.email github-actions[bot]@users.noreply.github.com
54+
git add references.md
55+
git commit -m "Add references.md"
56+
57+
echo "Push"
58+
git push origin main
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3961

4062
- name: Create comment - add step content
4163
run: |

0 commit comments

Comments
 (0)