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

[optimize] PR-Check Action #175

Merged
merged 1 commit into from
Jan 20, 2024
Merged
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
13 changes: 7 additions & 6 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Node.js to the latest version
uses: actions/setup-node@v2
with:
node-version: 'node'

- name: Checkout
uses: actions/checkout@v2

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

- name: Check PR for Members
if: steps.check-role.outputs.skip == 'false'
if: env.ROLE != 'admin' && env.ROLE != 'write'
run: |
GITHUB_USER="${{ github.actor }}"
MEMBER_DIR="./members/$GITHUB_USER"
Expand Down
Loading