Skip to content

Commit b8dd73a

Browse files
Use default github.token on forks (#154)
* Determine which token to use when running tests * Add workflow_dispatch to both workflows * Bump actions/checkout
1 parent 777bd7d commit b8dd73a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
pull_request:
88
branches:
99
- main
10+
workflow_dispatch:
1011

1112
jobs:
1213
build:
@@ -15,7 +16,7 @@ jobs:
1516
steps:
1617
- run: sudo apt-get install -y ruby-bundler
1718
name: Install prerequisites
18-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
1920
- run: bundle install
2021
name: Install bundle
2122
- run: bundle exec jekyll build

.github/workflows/run-tests.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ on:
99
- main
1010
schedule:
1111
- cron: "0 7 * * 1"
12+
workflow_dispatch:
1213

1314
jobs:
1415
run-tests:
1516
name: Run tests
1617
runs-on: ubuntu-latest
1718
container: dolfinx/dolfinx:stable
1819
steps:
19-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2021
- run: pip3 install pytest flake8
2122
name: Install pytest and flake8
2223
- run: pip3 install -r _test/requirements.txt
@@ -25,5 +26,15 @@ jobs:
2526
name: Run flake8 on tests
2627
- run: flake8 _tools/
2728
name: Run flake8 on tools
28-
- run: GITHUB_TOKEN=${{ secrets.symfembot_token }} python3 -m pytest _test/ --has-fenicsx 1
29+
- run: |
30+
TOKEN=${{ secrets.symfembot_token }}
31+
if [ -n "${TOKEN}" ]; then
32+
echo "token=${TOKEN}" >> ${GITHUB_OUTPUT}
33+
else
34+
echo "token=${{ github.token }}" >> ${GITHUB_OUTPUT}
35+
fi
36+
shell: bash
37+
name: Determine which token to use when running tests
38+
id: token
39+
- run: GITHUB_TOKEN=${{ steps.token.outputs.token }} python3 -m pytest _test/ --has-fenicsx 1
2940
name: Run tests

0 commit comments

Comments
 (0)