-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-helm-repo: fix oci image push failure #3418
Conversation
Signed-off-by: Vladimir Varankin <[email protected]>
@@ -94,8 +94,7 @@ jobs: | |||
needs: [setup] | |||
runs-on: ubuntu-latest | |||
permissions: | |||
contents: write # to push chart release, create release, and push tags to github |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still create a GH release. Don't we still need contents
helm-charts/.github/workflows/update-helm-repo.yaml
Lines 205 to 219 in 226cf91
- name: Make github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
${{ steps.parse-chart.outputs.desc }} | |
Source commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | |
Tag on source: https://github.com/${{ github.repository }}/releases/tag/${{ steps.parse-chart.outputs.tagname }} | |
files: | | |
${{ env.CR_PACKAGE_PATH }}/${{ steps.parse-chart.outputs.packagename }}.tgz | |
${{ env.CR_PACKAGE_PATH }}/${{ steps.parse-chart.outputs.packagename }}.tgz.prov | |
repository: grafana/helm-charts | |
tag_name: ${{ steps.parse-chart.outputs.tagname }} | |
token: ${{ env.AUTHTOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, the permissions
only apply to GITHUB_TOKEN
. But this workflow publishes the content via the app install token, which has the scope assigned when the app is installed.
Not that the workflow never had permissions
. They were added only recently in the #3366 (I don't think this was necessary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so in effect #3383 which you opened was unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This is the fixup for #3366
Relates to #3068
It turned out GitHub doesn't support publishing a package using GitHub App installation tokens (or fine-grained personal tokens). That is, as of today, the users are left with using either "classic" PAT with org-scopes or the magical
GITHUB_TOKEN
(docs).This PR fixes the
update-helm-repo
workflow, updating the last step to use theGITHUB_TOKEN
token. Otherwise, the workflow fails with:Note that, the package is pushed to the
GITHUB_REPOSITORY_OWNER
repository, under the namehelm-charts/<chart-name>
. The package than is automatically associated with the source repository that ran the push. This is similar to howhelm-chart/grafana-operator
is published currently (ref).