Coder Social home page Coder Social logo

gh-actions's Introduction

Keep Helm Dependencies Up to Date

NOTE: this project was inspired by hckops!

To test it, fork this repo. I recommend you to fork the main branch only.

Default - The GitHub Way

NOTE: you need to change the workflow permissions from Read repository contents and package permissions to Read and write permissions under your repository (Settings -> Actions -> General -> Workflow permissions). You have also to set Allow GitHub Actions to create and approve pull request

You can keep the config like:

name: test-helm-dependencies

on:
  # enable manual trigger
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
  push:
    branches:
      - main
    paths:
      - ".github/workflows/test-helm-dependencies.yml"
      - "helm-dependencies/**"
      - "examples/dependencies.yaml"

jobs:
  test-helm-dependencies:
    name: Test Example Chart
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        #with:
        #  ref: main

      - name: Helm Dependencies
        uses: ./helm-dependencies
        with:
          config-path: examples/dependencies.yaml
          user-email: "[email protected]"
          user-name: "dep-sheriff-bot"
          default-branch: "main"
          dry-run: false
          github-run: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The Action will be triggered on push to main or every 12 hours as cronjob.

You will get an output like:

Update Version Pull Request Text

Info - The Dry-Run Way

You need only to set the github-run flag to false and the dry-run flag to true like:

name: test-helm-dependencies

on:
  # enable manual trigger
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
  push:
    branches:
      - main
    paths:
      - ".github/workflows/test-helm-dependencies.yml"
      - "helm-dependencies/**"
      - "examples/dependencies.yaml"

jobs:
  test-helm-dependencies:
    name: Test Example Chart
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        #with:
        #  ref: main

      - name: Helm Dependencies
        uses: ./helm-dependencies
        with:
          config-path: examples/dependencies.yaml
          user-email: "[email protected]"
          user-name: "dep-sheriff-bot"
          default-branch: "main"
          dry-run: true
          github-run: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The Action will be triggered on push to main or every 12 hours as cronjob.

You will get an output like:

Pull Request Text

Remote - Use this action from this repo

create a dependencies.yaml like:

dependencies:
  - name: "External DNS"
    arrayPosition: 0
    sourcePath: examples/test-helm-chart/external-dns
    repositoryName: bitnami/external-dns

Create file .github/workflows/helm-dependencies-update.yml

name: helm-dependencies-update

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
  push:
    branches:
      - main
    paths:
      - ".github/workflows/helm-dependencies-update.yml"
      - "dependencies.yaml"

jobs:
  test-helm-dependencies:
    name: "Test: Helm Dependencies Update on Example Chart"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        #with:
        #  ref: main

      - name: Helm Dependencies
        uses: la-cc/gh-actions/[email protected]
        with:
          config-path: dependencies.yaml
          user-email: "[email protected]"
          user-name: "dep-sheriff-bot"
          default-branch: "main"
          dry-run: false
          github-run: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.