Skip to content

Commit cf00280

Browse files
authored
Refactor GitHub Actions workflow for PR creation
1 parent 007cdf8 commit cf00280

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,21 @@ name: test pr
22

33
on:
44
push:
5+
pull_request_target:
56

67
jobs:
78
hi:
89
runs-on: ubuntu-latest
910
name: hi job
1011
steps:
1112
- uses: actions/checkout@v6
12-
- id: secrets
13-
run: |
14-
git config --global user.email "bot@users.noreply.github.com"
15-
git config --global user.name "Cristovao Cordeiro Senior"
16-
git checkout -b robot-branch
17-
echo "hello" > testfile
18-
git add testfile
19-
git commit -am "test: open pr"
20-
21-
git push origin robot-branch
2213

2314
- env:
2415
GH_TOKEN: ${{ github.token }}
2516
run: |
26-
gh api \
27-
--method POST \
28-
-H "Accept: application/vnd.github+json" \
29-
-H "X-GitHub-Api-Version: 2022-11-28" \
30-
/repos/cjdcordeiro/ci-playground/pulls \
31-
-f 'title=Amazing new feature' -f 'body=Please pull these awesome changes in!' -f 'head=robot-branch' -f 'base=main'
32-
33-
17+
git checkout -b foo
18+
touch bar
19+
git add bar
20+
git commit -am "test"
21+
git remote set-url origin https://x-access-token:${{ secrets. GITHUB_TOKEN}}@github.com/cjdcordeiro/ci-playground.git
22+
git push origin foo

0 commit comments

Comments
 (0)