Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 96b716e

Browse files
authored
Merge pull request #175 from dethan3/main
[optimize] PR-Check Action
2 parents a2cbd05 + ac1e1fd commit 96b716e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/pr-check.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12+
- name: Set up Node.js to the latest version
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: 'node'
16+
1217
- name: Checkout
1318
uses: actions/checkout@v2
1419

@@ -23,16 +28,12 @@ jobs:
2328
"https://api.github.com/repos/$REPO/collaborators/$GITHUB_USER/permission" \
2429
| jq -r '.permission')
2530
echo "User role: $ROLE"
26-
if [[ "$ROLE" == "admin" || "$ROLE" == "write" ]]; then
27-
echo "::set-output name=skip::true"
28-
else
29-
echo "::set-output name=skip::false"
30-
fi
31+
echo "ROLE=$ROLE" >> $GITHUB_ENV
3132
env:
3233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3334

3435
- name: Check PR for Members
35-
if: steps.check-role.outputs.skip == 'false'
36+
if: env.ROLE != 'admin' && env.ROLE != 'write'
3637
run: |
3738
GITHUB_USER="${{ github.actor }}"
3839
MEMBER_DIR="./members/$GITHUB_USER"

0 commit comments

Comments
 (0)