diff --git a/CHANGES/833.bugfix b/CHANGES/833.bugfix new file mode 100644 index 00000000..ee95b003 --- /dev/null +++ b/CHANGES/833.bugfix @@ -0,0 +1 @@ +Use RELEASE_TOKEN for git operations in the release process. diff --git a/templates/github/.github/workflows/release.yml.j2 b/templates/github/.github/workflows/release.yml.j2 index 615c5c0c..dee52ec6 100644 --- a/templates/github/.github/workflows/release.yml.j2 +++ b/templates/github/.github/workflows/release.yml.j2 @@ -27,7 +27,7 @@ jobs: fail-fast: false steps: - {{ checkout(depth=0, path=plugin_name) | indent(6) }} + {{ checkout(depth=0, path=plugin_name, use_release_token=true) | indent(6) }} {{ setup_python(pyversion="3.8") | indent(6) }} diff --git a/templates/macros.j2 b/templates/macros.j2 index 79f8f16f..39d755a4 100644 --- a/templates/macros.j2 +++ b/templates/macros.j2 @@ -14,7 +14,7 @@ GITHUB_CONTEXT: "{{ '${{ github.event.pull_request.commits_url }}' }}" {%- endmacro -%} -{%- macro checkout(depth=1, repository=None, path=None, ref=None) -%} +{%- macro checkout(depth=1, repository=None, path=None, ref=None, use_release_token=false) -%} - uses: "actions/checkout@v4" with: fetch-depth: {{ depth }} @@ -27,6 +27,9 @@ GITHUB_CONTEXT: "{{ '${{ github.event.pull_request.commits_url }}' }}" {%- if ref %} ref: "{{ ref }}" {%- endif %} + {%- if use_release_token %} + token: {{ "${{ secrets.RELEASE_TOKEN }}" }} + {%- endif %} {%- endmacro -%}