Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: support fork repo to pull request #221

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
Expand All @@ -27,7 +31,7 @@ jobs:

semver-title:
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request')
if: (github.event_name == 'pull_request_target')
permissions:
pull-requests: write
steps:
Expand All @@ -40,7 +44,21 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: checkout PR
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Merge Branches
if: ${{ github.event_name == 'pull_request_target' }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "bot"

git remote add ${{ github.event.pull_request.base.repo.owner.login }} ${{ github.event.pull_request.base.repo.clone_url }}
git fetch ${{ github.event.pull_request.base.repo.owner.login }}
git merge ${{ github.event.pull_request.base.repo.owner.login }}/${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v2
with:
node-version: lts/*
Expand Down
5 changes: 4 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ coverage:
status:
project:
default:
target: auto # require coverage equal or more than current
target: auto # require coverage equal or more than current
if_ci_failed: error #success, failure, error, ignore

ignore:
- "src/test/**"

comment:
layout: "reach, diff, flags, files"
Loading