Skip to content

Commit ccb436e

Browse files
committed
ci: npm-publish checks
1 parent d60254f commit ccb436e

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,31 @@ concurrency:
2424
group: ${{ github.workflow }}-${{ github.ref }}
2525

2626
jobs:
27+
check-permissions:
28+
runs-on: ubuntu-latest
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
steps:
32+
- name: Check Main Branch
33+
if: github.ref != 'refs/heads/main'
34+
run: |
35+
echo "❌ Этот workflow может быть запущен только на основной ветке (main)"
36+
exit 1
37+
38+
- name: Verify Release Team
39+
run: |
40+
RELEASE_TEAM_MEMBERS=$(gh api "orgs/cdek-it/teams/react-native-release/members" \
41+
--jq 'map(.login)')
42+
43+
if ! echo "$RELEASE_TEAM_MEMBERS" | grep -q "$GITHUB_ACTOR"; then
44+
echo "❌ Этот workflow может быть запущен только участниками команды release"
45+
exit 1
46+
fi
47+
48+
- run: exit 1
2749
install:
2850
runs-on: ubuntu-latest
51+
needs: check-permissions
2952
steps:
3053
- uses: actions/checkout@v6
3154
- uses: ./.github/actions/setup-node

0 commit comments

Comments
 (0)