Skip to content

Commit cdf49a3

Browse files
authored
Merge pull request #58 from CoReason-AI/fix-docker-permissions-ghcr-1739309188844099428 (#59)
Fix 403 Forbidden on GHCR push by adding attestations permissions
1 parent 0d384d2 commit cdf49a3

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

hooks/post_gen_project.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
# Initialize git
2626
subprocess.run(["git", "init", "-b", "main"], check=True, shell=use_shell)
2727
subprocess.run(["git", "add", "."], check=True, shell=use_shell)
28-
subprocess.run(["git", "commit", "-m", "Initial commit from cookiecutter"], check=True, shell=use_shell)
28+
subprocess.run(
29+
["git", "commit", "-m", "Initial commit from cookiecutter"],
30+
check=True,
31+
shell=use_shell,
32+
)
2933

3034
# Install dependencies
3135
print("\nInstalling dependencies with Poetry...")

hooks/pre_gen_project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import re
1212
import sys
1313

14-
MODULE_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
14+
MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
1515

16-
module_name = '{{ cookiecutter.project_slug }}'
16+
module_name = "{{ cookiecutter.project_slug }}"
1717

1818
if not re.match(MODULE_REGEX, module_name):
19-
print(f'ERROR: The project slug ({module_name}) is not a valid Python module name.')
19+
print(f"ERROR: The project slug ({module_name}) is not a valid Python module name.")
2020
print('Please do not use a "-" and ensure it starts with a letter or underscore.')
2121
sys.exit(1)

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cookiecutter https://github.com/CoReason-AI/python_template --checkout main
1+
cookiecutter https://github.com/CoReason-AI/python_template --checkout main

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ jobs:
130130
with:
131131
user: __token__
132132
password: ${{ secrets.PYPI_API_TOKEN }}
133-
{% endraw %}
133+
{% endraw %}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
permissions:
1111
contents: read
1212
packages: write
13+
attestations: write
14+
id-token: write
1315

1416
concurrency:
1517
group: ${{ github.workflow }}-${{ github.ref }}
@@ -57,4 +59,4 @@ jobs:
5759
ignore-unfixed: true
5860
vuln-type: 'os,library'
5961
severity: 'CRITICAL,HIGH'
60-
{% endraw %}
62+
{% endraw %}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
# No 'user' or 'password' fields are needed here.
4343
# The action automatically uses the OIDC token from the
4444
# 'id-token: write' permission.
45-
{% endraw %}
45+
{% endraw %}

0 commit comments

Comments
 (0)