Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: clevyr/yampl-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: clevyr/yampl-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Feb 22, 2023

  1. 📝 Add description

    gabe565 committed Feb 22, 2023
    Copy the full SHA
    ce8707c View commit details

Commits on Feb 23, 2023

  1. ✨ Enable globstar shell opt

    gabe565 committed Feb 23, 2023
    Copy the full SHA
    9a1824e View commit details
  2. ✨ Add commit_branch input

    gabe565 committed Feb 23, 2023
    Copy the full SHA
    58d71ae View commit details

Commits on Mar 6, 2023

  1. ⬆️ Update dependency clevyr/yampl to v0.3.9 (#6)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 6, 2023
    Copy the full SHA
    9a105e3 View commit details

Commits on Mar 7, 2023

  1. Copy the full SHA
    69e17b3 View commit details
  2. ⬆️ Update dependency clevyr/yampl to v0.3.10 (#7)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 7, 2023
    Copy the full SHA
    46a8d8e View commit details
  3. Copy the full SHA
    cdadc34 View commit details
  4. Copy the full SHA
    4a5326b View commit details
  5. Copy the full SHA
    b5d5c8a View commit details

Commits on Apr 14, 2023

  1. Copy the full SHA
    5c51655 View commit details

Commits on Apr 15, 2023

  1. 📝 (readme): Fix headings

    gabe565 committed Apr 15, 2023
    Copy the full SHA
    6b471bf View commit details

Commits on Sep 5, 2023

  1. ⬆️ Update actions/checkout action to v4 (#8)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 5, 2023
    Copy the full SHA
    5c32649 View commit details

Commits on Sep 22, 2023

  1. Copy the full SHA
    a8a740c View commit details

Commits on Oct 18, 2023

  1. ⬆️ Update stefanzweifel/git-auto-commit-action action to v5 (#10)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 18, 2023
    Copy the full SHA
    235ba60 View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    6c8ea81 View commit details

Commits on Jun 28, 2024

  1. Copy the full SHA
    135024d View commit details
  2. ci: Add release workflow

    gabe565 committed Jun 28, 2024
    Copy the full SHA
    f559755 View commit details

Commits on Jul 26, 2024

  1. Copy the full SHA
    23fdb2c View commit details

Commits on Jul 27, 2024

  1. Copy the full SHA
    3ae0427 View commit details
  2. Copy the full SHA
    53b3689 View commit details
  3. Copy the full SHA
    34ec87c View commit details
  4. Copy the full SHA
    d81a7b5 View commit details
Showing with 106 additions and 50 deletions.
  1. +19 −0 .github/changelog-generator.yaml
  2. +26 −0 .github/workflows/release.yaml
  3. +20 −2 .github/workflows/test.yml
  4. +0 −13 .github/workflows/update-majorver.yml
  5. +1 −0 .gitignore
  6. +11 −10 README.md
  7. +27 −15 action.yml
  8. +0 −8 renovate.json
  9. +1 −1 test/expected.yaml
  10. +1 −1 test/input.yaml
19 changes: 19 additions & 0 deletions .github/changelog-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# yaml-language-server: $schema=https://gabe565.github.io/changelog-generator/config.schema.json
tag:
regexp: 'v\d+\.\d+\.\d+'
filters:
exclude:
- "^docs"
- "^test"
groups:
- title: Breaking Changes
order: 0
regexp: "^.+?!:"
- title: Features
order: 1
regexp: "^(feat)"
- title: Fixes
order: 2
regexp: "^(fix|perf)"
- title: Others
order: 999
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
id: changelog
uses: gabe565/changelog-generator@v1
- name: Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.changelog }}
- uses: nowactions/update-majorver@v1
22 changes: 20 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -5,10 +5,28 @@ on: push
jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
file: |
test/input.yaml
test/input2.yaml
test/*_input.yaml
vars: |
hello=world
tag=latest
- run: diff test/input.yaml test/expected.yaml
- run: diff test/input2.yaml test/expected2.yaml
- run: diff test/glob_input.yaml test/glob_expected.yaml

- run: git restore test
- name: Deprecated values input
uses: ./
with:
file: |
test/input.yaml
13 changes: 0 additions & 13 deletions .github/workflows/update-majorver.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,17 +4,18 @@ This action runs [yampl](https://github.com/clevyr/yampl) to template values in

See the [yampl](https://github.com/clevyr/yampl#readme) readme for more details on yampl templating capabilities.

# Usage
## Usage

## Inputs
### Inputs

- `file` - Path to the file that should be patched.
- `values` - List of values to replace in the provided file.
- `commit_message` - If set, this action will invoke [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) with the given commit message.
- `go_version` - Go version used to install Yampl
- `yampl_version` - Yampl version to install
| Name | Description | Required | Default |
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `file` | Path to the file that should be patched. | `true` | |
| `vars` | List of vars to replace in the provided file. | `true` | |
| `commit_message` | If set, this action will invoke [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) with the given commit message. | `false` | `""` |
| `yampl_version` | The Yampl version to install. | `false` | `latest` |

## Outputs
### Outputs

None

@@ -42,7 +43,7 @@ jobs:
uses: clevyr/yampl-action@v1
with:
file: deployment.yaml
values: |
vars: |
tag=${{ github.sha }}
commit_message: ":arrow_up: Bump deployment to ${{ steps.short-sha.outputs.sha }}"
commit_message: "chore: Bump deployment to ${{ steps.short-sha.outputs.sha }}"
```
42 changes: 27 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
name: Yampl
description: GitHub Action to invoke yampl during CI/CD.
inputs:
file:
description: Path to the file that should be patched.
required: true
values:
vars:
description: List of values to replace in the provided file.
required: true
values:
description: "Deprecated: Use vars instead"
default: ""
commit_message:
description: If set, this action will invoke stefanzweifel/git-auto-commit-action with the given commit message.
default: ""
go_version:
description: Go version used to install Yampl
# renovate datasource=docker depName=golang
default: "1.20"
commit_branch:
description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event
default: ${{ github.head_ref }}
yampl_version:
description: Yampl version to install
# renovate datasource=github-releases depName=clevyr/yampl
default: "v0.3.8"
default: latest
runs:
using: composite
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go_version }}
- name: Install Yampl
shell: bash
run: go install github.com/clevyr/yampl@${{ inputs.yampl_version }}
uses: clevyr/setup-yampl-action@v1
with:
version: ${{ inputs.yampl_version }}
- name: Patch file
shell: bash
env:
FILE: ${{ inputs.file }}
VARS: ${{ inputs.vars }}
VALUES: ${{ inputs.values }}
run: yampl --inplace --value="$VALUES" $FILE
run: |
shopt -s globstar 2>/dev/null || true
opts=( --inplace )
if [[ -n "$VARS" ]]; then
opts+=( --var="$VARS" )
fi
if [[ -n "$VALUES" ]]; then
echo '::warning::yampl-action "values" input is deprecated, use "vars" instead.'
opts+=( --value="$VALUES" )
fi
set -x
yampl "${opts[@]}" $FILE
- name: Commit changes
if: inputs.commit_message
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ inputs.commit_message }}
branch: ${{ inputs.commit_branch }}
8 changes: 0 additions & 8 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -11,14 +11,6 @@
"{{datasource}}",
"{{updateType}}"
],
"regexManagers": [
{
"fileMatch": ["\\.ya?ml$"],
"matchStrings": [
"# ?renovate datasource=(?<datasource>.+?) depName=(?<depName>.+)\\n.+: [\"']?(?<currentValue>.+?)[\"']?\\n"
]
}
],
"commitMessagePrefix": ":arrow_up:",
"packageRules": [
{
2 changes: 1 addition & 1 deletion test/expected.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
hello: world #yampl {{ .hello }}
image:
repository: golang:latest #yampl {{ .Value }}:{{ .tag }}
repository: golang:latest #yampl {{ current }}:{{ .tag }}
2 changes: 1 addition & 1 deletion test/input.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
hello: "" #yampl {{ .hello }}
image:
repository: golang #yampl {{ .Value }}:{{ .tag }}
repository: golang #yampl {{ current }}:{{ .tag }}