Skip to content

Dependency Dashboard #33

Dependency Dashboard

Dependency Dashboard #33

name: build-deploy-metabase-on-issue
on:
issues:
types: [opened, edited]
jobs:
build-metabase-image:
name: Build Metabase Image.
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Issue Forms Body Parser
id: parse
uses: zentered/[email protected]
- name: Stringify Result
if: ${{ steps.parse.outputs.data != "" }}

Check failure on line 21 in .github/workflows/metabase-update-on-issue.yml

View workflow run for this annotation

GitHub Actions / build-deploy-metabase-on-issue

Invalid workflow file

The workflow is not valid. .github/workflows/metabase-update-on-issue.yml (Line: 21, Col: 13): Unexpected symbol: '""'. Located at position 29 within expression: steps.parse.outputs.data != ""
uses: actions/github-script@v6
id: set-result
with:
script: |
const data = ${{ steps.parse.outputs.data }};
const version = data["metabase-version"].text;
return version;
result-encoding: string
- name: check if build is required.
id: check
run: |
# Check if version paramter is given.
METABASE_VERSION=${{ steps.set-result.outputs.result }}
URL="https://downloads.metabase.com/$METABASE_VERSION/metabase.jar"
if [ -z $METABASE_VERSION ] || [ $(curl -ILso /dev/null -w "%{http_code}" "${URL}") -ne 200 ]
then
echo "build=false" >> $GITHUB_OUTPUT;
exit 0
fi
echo "build=true" >> $GITHUB_OUTPUT;
#
- name: Modify Files
if: steps.check.outputs.build == 'true'
id: modify_files
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
appVersion=${{ steps.set-result.outputs.result }}
version=${appVersion//v/}
git config --local user.name ${{ github.actor }}
git checkout -b deps/metabase-version-update-$appVersion
yq eval '.appVersion = $appVersion' -i charts/nr-metabase/Chart.yaml
yq eval '.version = $version' -i charts/nr-metabase/Chart.yaml
yq eval '.metabase.image.tag = $appVersion' -i charts/nr-metabase/values.yaml
yq eval '.global.appVersion = $appVersion' -i charts/nr-metabase/values.yaml
git add charts/nr-metabase/values.yaml charts/nr-metabase/Chart.yaml
git commit -m "Updating the version of the metabase image to $appVersion"
git push origin deps/metabase-version-update-$appVersion
# Create a Pull Request
gh pr create --assignee "mishraomp" --base main --label "dependencies" --title "Updating the version of the metabase image to $appVersion" --body "Updating the version of the metabase image to $appVersion."