Skip to content

Commit e707747

Browse files
authored
Merge pull request #41 from ssciwr/tokenless-codecov
Tokenless Codecov authentication
2 parents 42b03b3 + f06a5a3 commit e707747

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

hooks/pre_gen_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import sys
99

10+
1011
# Call fail_if with a Jinja template-based condition to abandon the
1112
# cookiecutter generation process with an error.
1213
def fail_if(condition, message):

{{cookiecutter.project_slug}}/.github/workflows/ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ jobs:
5151
- name: Checkout repository
5252
uses: actions/checkout@v4
5353

54-
- name: Set up Python ${{ "{{ matrix.python-version }}" }}
55-
uses: actions/setup-python@v5
54+
- uses: actions/setup-python@v5
5655
with:
57-
python-version: "3.8"
56+
python-version: "3.13"
5857

5958
- name: Install Python package
6059
run: |
@@ -66,9 +65,7 @@ jobs:
6665
python -m pytest --cov --cov-report=xml
6766
6867
- name: Upload coverage to Codecov
69-
uses: codecov/codecov-action@v4
68+
uses: codecov/codecov-action@v5
7069
with:
7170
fail_ci_if_error: true
7271
files: ./tests/coverage.xml
73-
env:
74-
CODECOV_TOKEN: ${{ "{{ secrets.CODECOV_TOKEN }}" }}

{{cookiecutter.project_slug}}/TODO.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ The following tasks need to be done to get a fully working project:
1919
* Enable the integration of Readthedocs with your Git hoster. In the case of Github, this means
2020
that you need to login at [Read the Docs](https://readthedocs.org) and click the button
2121
*Import a Project*.
22+
{%- if cookiecutter.github_actions_ci == 'Yes' %}
2223
* Enable the integration with `codecov.io` by heading to the [Codecov.io Website](https://codecov.io),
2324
log in (e.g. with your Github credentials) and enable integration for your repository. In order to do
24-
so, you need to select it from the list of repositories (potentially re-syncing with GitHub) and head
25-
to the Settings Tab. Within setting, get your token for this repository and put store it as a secret
26-
called `CODECOV_TOKEN` for GitHub Actions.
25+
so, you need to select it from the list of repositories (potentially re-syncing with GitHub). Then, head
26+
to the "Settings" Tab and select "Global Upload Token". Here, you should select the "not required" option.
27+
{%- endif %}

0 commit comments

Comments
 (0)