1+ name : PR
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, edited]
6+ branches : [ "main", "*-stable", "release/*" ]
7+
8+ concurrency :
9+ # Ensure single build of a pull request. `main` should not be affected.
10+ group : ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ lint-commit :
15+ name : " Lint PR title"
16+ permissions : {}
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ filter : blob:none
22+ fetch-depth : 0
23+ - uses : actions/setup-node@v4
24+ with :
25+ node-version : ' 22'
26+ # We lint the PR title instead of the commit message to avoid script injection attacks.
27+ # Using environment variables prevents potential security vulnerabilities as described in:
28+ # https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack
29+ - name : Lint PR title
30+ env :
31+ PR_TITLE : ${{ github.event.pull_request.title }}
32+ run : |
33+ echo "$PR_TITLE" | npx @rnx-kit/[email protected] 34+ npm-publish-dry-run :
35+ name : " NPM Publish (Dry Run)"
36+ permissions : {}
37+ runs-on : ubuntu-latest
38+ env :
39+ PUBLISH_TAG : ' latest'
40+ steps :
41+ - uses : actions/checkout@v4
42+ with :
43+ filter : blob:none
44+ fetch-depth : 0
45+ - uses : actions/setup-node@v4
46+ with :
47+ node-version : ' 22'
48+ - name : Configure git
49+ run : |
50+ git config --global user.email "[email protected] " 51+ git config --global user.name "React-Native Bot"
52+ git remote set-url origin https://rnbot:${{ secrets.GITHUB_TOKEN }}@github.com/microsoft/react-native-macos
53+ - name : Install dependencies
54+ run : yarn
55+ - name : Verify release config
56+ run : |
57+ node .ado/scripts/prepublish-check.mjs --verbose --skip-auth --tag ${{ env.PUBLISH_TAG }}
58+ - name : Version and publish packages (dry run)
59+ run : |
60+ echo "Target branch: ${{ github.base_ref }}"
61+ yarn nx release --dry-run --verbose
0 commit comments