File tree Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Original file line number Diff line number Diff line change 1
1
name : Step 1
2
2
3
3
on :
4
- pull_request :
5
- branches : [main] # Trigger only for PRs targeting the 'main' branch
6
- types : [opened] # Only when the PR is opened (created)
4
+ pull_request_target :
5
+ branches : [main]
6
+ types : [opened]
7
+ workflow_dispatch : {}
7
8
8
9
permissions :
9
10
contents : write
10
11
actions : write
11
12
issues : write
13
+ pull-requests : write # Required for commenting or updating PR
12
14
13
15
env :
14
16
STEP_2_FILE : " .github/steps/2-resolve-a-merge-conflict.md"
26
28
ISSUE_URL : ${{ needs.find_exercise.outputs.issue-url }}
27
29
28
30
steps :
29
- - name : Checkout
31
+ - name : Checkout the base branch (main)
30
32
uses : actions/checkout@v4
33
+ with :
34
+ ref : main # Required because pull_request_target runs in the base branch context
31
35
32
36
- name : Get response templates
33
37
uses : actions/checkout@v4
56
60
gh workflow enable "Step 2"
57
61
env :
58
62
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
-
60
- # Debug steps (optional) ...
61
- - name : Debug - print event payload
62
- run : |
63
- echo "EVENT PAYLOAD:"
64
- cat $GITHUB_EVENT_PATH
65
-
66
- - name : Debug - list files
67
- run : |
68
- echo "Current directory: $(pwd)"
69
- ls -al
70
- echo "Contents of .github/steps:"
71
- ls -al .github/steps || echo ".github/steps does not exist"
72
-
73
- - name : Debug - print environment variables
74
- run : env
You can’t perform that action at this time.
0 commit comments