Skip to content
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 .env file with latest tag #14

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


# Images
IMAGE_VERSION=1.0.0
IMAGE_VERSION=1.1.1
IMAGE_NAME=718306648796.dkr.ecr.eu-west-1.amazonaws.com/opentelemetry-demo
TRACETEST_IMAGE_VERSION=v0.14.5

Expand Down
37 changes: 30 additions & 7 deletions .github/actions/update-env-file/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ name: Deploy Dash0 OTel Demo
description: deploy a release of the Dash0 fork of the OpenTelemetry demo
inputs:
containerImageVersion:
description: 'version tag of the Dash0 OTel Demo container images, e.g. 1.1.0'
description: "version tag of the Dash0 OTel Demo container images, e.g. 1.1.0"
required: true
token:
description: "token granting read/write access to dash0-configuration repository."
required: true

runs:
Expand All @@ -19,9 +22,29 @@ runs:
shell: bash
run: |
sed -i "s/^IMAGE_VERSION=[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$/IMAGE_VERSION=${{ inputs.containerImageVersion }}/" .env
git --no-pager diff .env
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .env
git commit -m"[dash0] update image version in .env to ${{ inputs.containerImageVersion }}"
git push

- name: create pull request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
title: update .env file with latest tag
commit-message: '[dash0] update image version in .env to ${{ inputs.containerImageVersion }}'
add-paths: .env
base: main
branch: env-file-update
author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'

- name: auto approve
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}

- name: enable pull request auto merge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ inputs.token }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
29 changes: 29 additions & 0 deletions .github/workflows/update-env-file-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: "Update .env file only"

on:
workflow_dispatch:
inputs:
version:
description: the version tag to put into the .env file
required: true
type: string

jobs:

update-release-in-env-file:
name: update .env file
runs-on: ubuntu-latest
concurrency: update-env-file
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: update .env file
uses: ./.github/actions/update-env-file
with:
containerImageVersion: ${{ inputs.version }}
token: ${{ secrets.REPOSITORY_FULL_ACCESS_GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion regenerate-grpc-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set -euo pipefail
# This script is used to update generated code after changing demo.proto.

cd -P -- "$(dirname -- "$0")"
pwd

command -v npm >/dev/null 2>&1 || {
cat <<EOF >&2
Expand Down