Skip to content

Commit

Permalink
Merge pull request #24 from camptocamp/fix-publish
Browse files Browse the repository at this point in the history
Fix publish
  • Loading branch information
sbrunner authored Nov 28, 2024
2 parents 260a367 + 68ccbfd commit e2104ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _Tag Publish configuration file (.github/publish.yaml)_
- **`repository`** _(object)_: The packages repository where we should publish the packages. Can contain additional properties. Default: `{"github": {"host": "npm.pkg.github.com"}}`.
- **Additional properties** _(object)_
- **`host`** _(string)_: The host of the repository URL.
- **`args`** _(array)_: The arguments to pass to the publish command. Default: `["--provenance"]`.
- **`args`** _(array)_: The arguments to pass to the publish command. Default: `["--provenance", "--access=public"]`.
- **Items** _(string)_
- <a id="definitions/helm"></a>**`helm`** _(object)_: Configuration to publish Helm charts on GitHub release.
- **`packages`** _(array)_: The configuration of packages that will be published.
Expand Down
3 changes: 2 additions & 1 deletion tag_publish/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class HelmPackage(TypedDict, total=False):
"""


NODE_ARGS_DEFAULT = ["--provenance"]
NODE_ARGS_DEFAULT = ["--provenance", "--access=public"]
""" Default value of the field path 'node args' """


Expand Down Expand Up @@ -352,6 +352,7 @@ class Node(TypedDict, total=False):
default:
- --provenance
- --access=public
"""


Expand Down
6 changes: 6 additions & 0 deletions tag_publish/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ def helm(folder: str, version: str, owner: str, repo: str, commit_sha: str, toke
if dependency["repository"].startswith("https://"):
subprocess.run(["helm", "repo", "add", str(index), dependency["repository"]], check=True)

if subprocess.run(["git", "config", "user.email"], capture_output=True).returncode != 0: # pylint: disable=subprocess-run-check
subprocess.run(["git", "config", "--global", "user.email", "[email protected]"], check=True)
if subprocess.run(["git", "config", "user.name"], capture_output=True).returncode != 0: # pylint: disable=subprocess-run-check
subprocess.run(
["git", "config", "--global", "user.name", "tag-publish (GitHub Action)"], check=True
)
subprocess.run(["cr", "package", folder], check=True)
subprocess.run(
[
Expand Down
2 changes: 1 addition & 1 deletion tag_publish/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"title": "Node args",
"description": "The arguments to pass to the publish command",
"type": "array",
"default": ["--provenance"],
"default": ["--provenance", "--access=public"],
"items": {
"type": "string"
}
Expand Down

0 comments on commit e2104ee

Please sign in to comment.