Skip to content

Update dynamic-plugins.default.yaml #250

Update dynamic-plugins.default.yaml

Update dynamic-plugins.default.yaml #250

# Copyright Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Update dynamic-plugins.default.yaml
on:
# workflow_dispatch so that it can be triggered manually if needed
workflow_dispatch:
schedule:
# run at 2:48 UTC every day
- cron: "48 2 * * *"
push:
branches:
- 'main'
- 'release-**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update-dynamic-plugins-default:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: Update dynamic-plugins.default.yaml from latest quay.io/rhdh/plugin-catalog-index:1.y container
run: |
unpack () {
local IMAGE="$1"
DIR="/tmp/${IMAGE//:/_}"
rm -fr "$DIR"; mkdir -p "$DIR"
# set -x
skopeo copy "docker://quay.io/rhdh/${IMAGE}" "oci:/tmp/oci-${IMAGE//:/_}" || \
{ echo "::error::Container image quay.io/rhdh/${IMAGE} not found - nothing to do!"; exit 0; }
# Extract all layers
for blob in /tmp/oci-${IMAGE//:/_}/blobs/sha256/*; do
tar -xf "$blob" -C "$DIR/" 2>/dev/null || true
done
rm -rf "/tmp/oci-${IMAGE//:/_}"
# set +x
echo "Unpacked $IMAGE into $DIR"
# replace local dynamic-plugins.default.yaml file with latest from the index container image, and add a deprecation warning
echo -e "\
# THIS FILE IS DEPRECATED. CONTENTS ARE GENERATED - DO NOT EDIT!\n\
#\n\
# File dynamic-plugins.default.yaml is now generated from default.package.yaml (in this repo)\n\
# and default configuration located in the overlays repo under workspaces/*/metadata/*.yaml\n\
# See https://github.com/redhat-developer/rhdh-plugin-export-overlays/\n\
#\n\
# To fetch + unpack the latest index image see \n\
# https://github.com/redhat-developer/rhdh/blob/main/.github/workflows/update-dynamic-plugins-default.yaml#L44-L75
" > dynamic-plugins.default.yaml
cat "$DIR"/dynamic-plugins.default.yaml >> dynamic-plugins.default.yaml
}
TAG=$(jq -r '.version' package.json) # 1.9.0
unpack "plugin-catalog-index:${TAG}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
with:
app-id: ${{ secrets.RHDH_GITHUB_APP_ID }}
private-key: ${{ secrets.RHDH_GITHUB_APP_PRIVATE_KEY }}
- name: Create Pull Request to update dynamic-plugins.default.yaml
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: |
chore: update dynamic-plugins.default.yaml from quay.io/rhdh/plugin-catalog-index:${{ env.TAG }}
branch: chore/automated-update-dpdy-${{ github.ref_name }}-${{ env.TAG }}
title: "chore: [${{ github.ref_name }}] update dynamic-plugins.default.yaml from quay.io/rhdh/plugin-catalog-index:${{ env.TAG }}"
body: |
This PR contains generated updates to *dynamic-plugins.default.yaml* from *quay.io/rhdh/plugin-catalog-index:${{ env.TAG }}*
NOTE:
File dynamic-plugins.default.yaml is now generated from default.package.yaml (in this repo)
and default configuration located in the overlays repo under workspaces/*/metadata/*.yaml
See https://github.com/redhat-developer/rhdh-plugin-export-overlays/
To fetch + unpack the latest index image see
https://github.com/redhat-developer/rhdh/blob/main/.github/workflows/update-dynamic-plugins-default.yaml#L44-L75
Auto-generated by workflow: *${{ github.workflow }}*
labels: "documentation"
signoff: true
author: "rhdh-bot <[email protected]>"
delete-branch: true