Skip to content

Commit d082c14

Browse files
authored
ci: fix ci issues (#32)
## Description <!-- Provide a brief description of your changes --> **Note:** PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat(devbox): add support for custom env vars` or `fix(snapshot): resolve pagination issue`) as they are used for automatic release notes generation. ## Type of Change <!-- Mark the relevant option with an 'x' --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test updates ## Related Issues <!-- Link to related issues using #issue-number --> Closes # ## Changes Made <!-- Describe the changes in detail --> ## Testing <!-- Describe how you tested your changes --> - [ ] I have tested locally - [ ] I have added/updated tests - [ ] All existing tests pass ## Checklist - [ ] My code follows the code style of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Add screenshots to help explain your changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent 940cdc8 commit d082c14

2 files changed

Lines changed: 20 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
jobs:
1111
format:
1212
runs-on: ubuntu-latest
13-
# Only run from pull_request_target if it's a release-please branch, otherwise skip (to avoid duplicate runs)
14-
if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
13+
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
14+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818
with:
19-
# For pull_request_target, explicitly checkout the PR head
19+
# For pull_request_target, explicitly checkout the PR head (for security)
20+
# For regular pull_request and workflow_dispatch, checkout action uses defaults
2021
ref: ${{ github.event.pull_request.head.sha }}
21-
# Only checkout PR code if it's from the same repo (safe for release-please)
2222
repository: ${{ github.event.pull_request.head.repo.full_name }}
2323

2424
- name: Setup Node.js
@@ -35,15 +35,15 @@ jobs:
3535

3636
lint:
3737
runs-on: ubuntu-latest
38-
# Only run from pull_request_target if it's a release-please branch, otherwise skip (to avoid duplicate runs)
39-
if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
38+
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
39+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
4040
steps:
4141
- name: Checkout code
4242
uses: actions/checkout@v4
4343
with:
44-
# For pull_request_target, explicitly checkout the PR head
44+
# For pull_request_target, explicitly checkout the PR head (for security)
45+
# For regular pull_request and workflow_dispatch, checkout action uses defaults
4546
ref: ${{ github.event.pull_request.head.sha }}
46-
# Only checkout PR code if it's from the same repo (safe for release-please)
4747
repository: ${{ github.event.pull_request.head.repo.full_name }}
4848

4949
- name: Setup Node.js
@@ -60,15 +60,15 @@ jobs:
6060

6161
build:
6262
runs-on: ubuntu-latest
63-
# Only run from pull_request_target if it's a release-please branch, otherwise skip (to avoid duplicate runs)
64-
if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
63+
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
64+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
6565
steps:
6666
- name: Checkout code
6767
uses: actions/checkout@v4
6868
with:
69-
# For pull_request_target, explicitly checkout the PR head
69+
# For pull_request_target, explicitly checkout the PR head (for security)
70+
# For regular pull_request and workflow_dispatch, checkout action uses defaults
7071
ref: ${{ github.event.pull_request.head.sha }}
71-
# Only checkout PR code if it's from the same repo (safe for release-please)
7272
repository: ${{ github.event.pull_request.head.repo.full_name }}
7373

7474
- name: Setup Node.js
@@ -86,15 +86,15 @@ jobs:
8686
test:
8787
runs-on: ubuntu-latest
8888
needs: build
89-
# Only run from pull_request_target if it's a release-please branch, otherwise skip (to avoid duplicate runs)
90-
if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
89+
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
90+
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
9191
steps:
9292
- name: Checkout code
9393
uses: actions/checkout@v4
9494
with:
95-
# For pull_request_target, explicitly checkout the PR head
95+
# For pull_request_target, explicitly checkout the PR head (for security)
96+
# For regular pull_request and workflow_dispatch, checkout action uses defaults
9697
ref: ${{ github.event.pull_request.head.sha }}
97-
# Only checkout PR code if it's from the same repo (safe for release-please)
9898
repository: ${{ github.event.pull_request.head.repo.full_name }}
9999

100100
- name: Setup Node.js
@@ -120,8 +120,8 @@ jobs:
120120
ready-to-merge:
121121
runs-on: ubuntu-latest
122122
needs: [format, lint, build, test]
123-
# Only run from pull_request_target if it's a release-please branch, otherwise skip (to avoid duplicate runs)
124-
if: always() && (github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch')
123+
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
124+
if: always() && ((github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch')
125125
steps:
126126
- name: Check all jobs passed
127127
run: |

.github/workflows/pr-title.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,18 @@ jobs:
3333
mcp
3434
devbox
3535
blueprint
36+
main
3637
snapshot
3738
config
3839
auth
39-
ui
4040
deps
4141
# Ensure the subject starts with a lowercase letter
4242
subjectPattern: ^(?![A-Z]).+$
4343
subjectPatternError: |
4444
The subject "{subject}" found in the pull request title "{title}"
4545
should start with a lowercase letter.
46-
46+
4747
Examples:
4848
- feat: add new devbox command
4949
- fix(cli): resolve argument parsing issue
5050
- docs: update README with usage examples
51-

0 commit comments

Comments
 (0)