File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Code Freeze
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ workflow_dispatch :
8
+
9
+ permissions :
10
+ contents : read
11
+
12
+ env :
13
+ FROZEN : ${{ vars.FROZEN }}
14
+ UNFROZEN_PREFIX : ${{ vars.UNFROZEN_PREFIX }}
15
+
16
+ jobs :
17
+ check-pr-frozen-status :
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - name : Fetch PR data and check if merge allowed
21
+ if : env.FROZEN == 'true'
22
+ env :
23
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
+ run : |
25
+ PR_DATA=$(curl -s \
26
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
27
+ -H "Accept: application/vnd.github.v3+json" \
28
+ https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
29
+ BRANCH_NAME=$(echo $PR_DATA | jq .head.ref -r)
30
+ PR_TITLE=$(echo $PR_DATA | jq .title -r)
31
+
32
+ echo $BRANCH_NAME
33
+ echo $PR_TITLE
34
+
35
+ if [[ "$BRANCH_NAME" != $UNFROZEN_PREFIX* ]] &&
36
+ [[ "$PR_TITLE" != fix:* && "$PR_TITLE" != *"[critical]"* ]]; then
37
+ echo "Error: You can only merge from branches that start with '$UNFROZEN_PREFIX', or PRs titled with 'fix: ' and containing '[critical]'."
38
+ exit 1
39
+ fi
Original file line number Diff line number Diff line change 6
6
- main
7
7
- feature/**
8
8
9
+ permissions :
10
+ contents : read
11
+
9
12
jobs :
10
13
twine-check :
11
14
name : Check long description
20
23
run : python -m pip install --user --upgrade wheel
21
24
- name : Install twine
22
25
run : python -m pip install --user --upgrade twine
26
+ - name : Install setuptools
27
+ run : python -m pip install --user --upgrade setuptools
23
28
- name : Build a binary wheel and a source tarball
24
29
run : python setup.py sdist bdist_wheel
25
30
- name : Check that long description will render correctly on PyPI.
You can’t perform that action at this time.
0 commit comments