File tree Expand file tree Collapse file tree 5 files changed +77
-8
lines changed Expand file tree Collapse file tree 5 files changed +77
-8
lines changed Original file line number Diff line number Diff line change 1+ name : " Check Links"
2+ description : " Run a link check function for a repo"
3+ runs :
4+ using : " composite"
5+ steps :
6+ - shell : bash
7+ id : check-links
8+ run : |
9+ set -eux
10+
11+ # Set up env variables
12+ export RH_REPOSITORY=${GITHUB_REPOSITORY}
13+ export RH_REF=${GITHUB_REF}
14+
15+ if [ ! -z ${GITHUB_BASE_REF} ]; then
16+ echo "Using GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
17+ export RH_BRANCH=${GITHUB_BASE_REF}
18+ else
19+ # e.g refs/head/foo or refs/tag/bar
20+ echo "Using GITHUB_REF: ${GITHUB_REF}"
21+ export RH_BRANCH=$(echo ${GITHUB_REF} | cut -d'/' -f 3-)
22+ fi
23+
24+ # Install Jupyter Releaser from git unless we are testing Releaser itself
25+ if ! command -v jupyter-releaser &> /dev/null
26+ then
27+ pip install git+https://github.com/jupyter-server/jupyter_releaser.git
28+ fi
29+
30+ jupyter-releaser prep-git
31+ jupyter-releaser check-links --force
Original file line number Diff line number Diff line change 3434 restore-keys : |
3535 ${{ runner.os }}-pip-
3636 ${{ runner.os }}-pip-
37- - name : Cache checked links
38- uses : actions/cache@v2
39- with :
40- path : ~/.cache/pytest-link-check
41- key : ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md') }}-md-links
42- restore-keys : |
43- ${{ runner.os }}-linkcheck-
4437 - name : Print env
4538 run : env
4639 - name : Upgrade packaging dependencies
Original file line number Diff line number Diff line change 2929 echo "or after-the-fact on already committed files with"
3030 echo " pre-commit run --all-files"
3131
32+ check-links :
33+ runs-on : ubuntu-20.04
34+
35+ steps :
36+ - uses : actions/checkout@v2
37+ - uses : actions/setup-python@v2
38+ with :
39+ python-version : 3.9
40+ - name : Get pip cache dir
41+ id : pip-cache
42+ run : |
43+ echo "::set-output name=dir::$(pip cache dir)"
44+ - name : Cache pip
45+ uses : actions/cache@v2
46+ with :
47+ path : ${{ steps.pip-cache.outputs.dir }}
48+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
49+ restore-keys : |
50+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
51+ ${{ runner.os }}-pip-
52+ - name : Install the Python dependencies
53+ run : |
54+ pip install -e .[test] codecov
55+ - name : Cache checked links
56+ uses : actions/cache@v2
57+ with :
58+ path : ~/.cache/pytest-link-check
59+ key : ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md') }}-md-links
60+ restore-keys : |
61+ ${{ runner.os }}-linkcheck-
62+ - name : Install the Python dependencies
63+ run : |
64+ pip install -e .[test] codecov
65+ - name : Check Links
66+ uses : ./.github/actions/check-links
67+
3268 build :
3369 runs-on : ${{ matrix.os }}-latest
3470 strategy :
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ def invoke(self, ctx):
5151 hooks = config .get ("hooks" , {})
5252 options = config .get ("options" , {})
5353 skip = config .get ("skip" , [])
54+ if "--force" in ctx .args :
55+ skip = []
56+ ctx .args .remove ("--force" )
5457
5558 # Print a separation header
5659 util .log (f'\n \n { "-" * 50 } ' )
@@ -119,7 +122,10 @@ def list_commands(self, ctx):
119122
120123
121124@click .group (cls = ReleaseHelperGroup )
122- def main ():
125+ @click .option (
126+ "--force" , default = False , help = "Force a command to run even when skipped by config"
127+ )
128+ def main (force ):
123129 """Jupyter Releaser scripts"""
124130 pass
125131
Original file line number Diff line number Diff line change @@ -19,5 +19,8 @@ tag_template = "v{new_version}"
1919[[tool .tbump .file ]]
2020src = " jupyter_releaser/__init__.py"
2121
22+ [tool .jupyter-releaser ]
23+ skip = [" check-links" ]
24+
2225[tool .jupyter-releaser .hooks ]
2326after-draft-release = " bash ./.github/scripts/bump_tag.sh"
You can’t perform that action at this time.
0 commit comments