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 11name : Step 1
22
33on :
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 : {}
78
89permissions :
910 contents : write
1011 actions : write
1112 issues : write
13+ pull-requests : write # Required for commenting or updating PR
1214
1315env :
1416 STEP_2_FILE : " .github/steps/2-resolve-a-merge-conflict.md"
2628 ISSUE_URL : ${{ needs.find_exercise.outputs.issue-url }}
2729
2830 steps :
29- - name : Checkout
31+ - name : Checkout the base branch (main)
3032 uses : actions/checkout@v4
33+ with :
34+ ref : main # Required because pull_request_target runs in the base branch context
3135
3236 - name : Get response templates
3337 uses : actions/checkout@v4
5660 gh workflow enable "Step 2"
5761 env :
5862 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