Skip to content

Commit 66d949c

Browse files
committed
[ core/pre-review ] DRAFT: github-actions pre review init
1 parent d6cc6f9 commit 66d949c

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/pre-review.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PR Pre-review
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
SKIP_REST: false
12+
13+
jobs:
14+
pre-review:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'npm'
26+
27+
- name: Collect information
28+
run: |
29+
GITHUB_HANDLE=$GITHUB_TRIGGERING_ACTOR;
30+
echo "GITHUB_HANDLE=$GITHUB_HANDLE" >> $GITHUB_ENV;
31+
CHANGED_FILES=$(git --no-pager diff -X --name-only -- origin/master);
32+
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV;
33+
- name: Run "preReview" script
34+
run: |
35+
node ./generators/preReview.js "$GITHUB_HANDLE" "$CHANGED_FILES"

generators/preReview.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const contributorHandle = process.env.GITHUB_HANDLE
2+
console.log('contributorHandle:', contributorHandle)
3+
const changedFiles = process.env.CHANGED_FILES
4+
console.log('changedFiles:', changedFiles)
5+

0 commit comments

Comments
 (0)