Skip to content

Commit

Permalink
fix: package permission on action (#1072)
Browse files Browse the repository at this point in the history
Co-authored-by: Dustin Deus <deusdustin@gmail.com>
  • Loading branch information
AndreasZeissner and StarpTech authored Aug 14, 2024
1 parent f17f15c commit 0a3e1fd
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 54 deletions.
4 changes: 0 additions & 4 deletions .github/actions/helm-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ inputs:
required: true
type: string

permissions:
contents: read
packages: write

runs:
using: composite
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
exit 1
- name: Perform CodeQL Analysis
if: "(github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))"
if: (github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
9 changes: 1 addition & 8 deletions .github/workflows/helm-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
name: Helm CI
on:
push:
branches-ignore:
- "release-please--**"
pull_request:
paths:
- "helm/**/*"
- ".github/workflows/helm-ci.yaml"
# do not trigger on what usually the release-please bot would do
# otherwise this is triggered also on pull requests from the bot
- "helm/**/CHANGELOG.md"
- "helm/**/Chart.yaml"

concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
Expand Down Expand Up @@ -48,5 +41,5 @@ jobs:
working-directory: ./helm

- name: Check if git is not dirty after generating files
if: "(github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))"
if: (github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))
run: git diff --no-ext-diff --exit-code ./helm
11 changes: 2 additions & 9 deletions .github/workflows/helm-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
name: Helm Deployment
on:
push:
branches-ignore:
- "release-please--**"
pull_request:
paths:
- "helm/**/*"
- ".github/workflows/helm-ci.yaml"
# do not trigger on what usually the release-please bot would do
# otherwise this is triggered also on pull requests from the bot
- "helm/**/CHANGELOG.md"
- "helm/**/Chart.yaml"

concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
Expand Down Expand Up @@ -50,13 +43,13 @@ jobs:
kbld version
- name: start minikube
if: "(github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))"
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')
id: minikube
uses: medyagh/setup-minikube@v0.0.14
with:
addons: ingress

- name: Deploy to minikube
if: "(github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')) || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release-please--'))"
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/release-please--')
working-directory: ./helm
run: make deploy KAPP_ARGS="-y --logs-all"
3 changes: 3 additions & 0 deletions .github/workflows/helm-release-docs-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_HELM_RELEASES }}

- uses: ./.github/actions/go

Expand All @@ -39,6 +41,7 @@ jobs:
with:
commit_message: 'chore: update helm docs and prepare release'
file_pattern: 'helm/**/*.md'
token: ${{ secrets.GH_TOKEN_HELM_RELEASES }}
commit_user_name: hardworker-bot
commit_user_email: bot@wundergraph.com
commit_author: hardworker-bot <bot@wundergraph.com>
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
contents: write
pull-requests: write
packages: write

env:
CI: true
Expand Down Expand Up @@ -43,7 +44,7 @@ jobs:
working-directory: ./helm
registry: ${{ env.REGISTRY }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GH_TOKEN_HELM_RELEASES }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
make-target: publish-cosmo-chart

- uses: ./.github/actions/helm-release
Expand All @@ -52,5 +53,5 @@ jobs:
working-directory: ./helm
registry: ${{ env.REGISTRY }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GH_TOKEN_HELM_RELEASES }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
make-target: publish-router-chart
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"helm/cosmo": "0.8.0",
"helm/cosmo": "0.7.0",
"helm/cosmo/charts/router": "0.6.0"
}
25 changes: 0 additions & 25 deletions helm/cosmo/CHANGELOG.md

This file was deleted.

5 changes: 2 additions & 3 deletions helm/cosmo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apiVersion: v2
name: cosmo
description: This is the official Helm Chart for WunderGraph Cosmo - The Full
Lifecycle GraphQL API Management Solution.
description: This is the official Helm Chart for WunderGraph Cosmo - The Full Lifecycle GraphQL API Management Solution.

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -16,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: '0.8.0'
version: '0.7.0'

home: https://github.com/wundergraph/cosmo

Expand Down
2 changes: 1 addition & 1 deletion helm/cosmo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

For a detailed deployment guide of the chart, including the full documentation, see the [DEV.md](DEV.md) file.

![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

This is the official Helm Chart for WunderGraph Cosmo - The Full Lifecycle GraphQL API Management Solution.

Expand Down

0 comments on commit 0a3e1fd

Please sign in to comment.