forked from che-samples/web-php-simple
-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 1.53 KB
/
rebuild-devfile-registry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Copyright (c) 2022 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Rebuild Devfile Registry
on:
push:
branches:
- 'devspaces-[0-9].[0-9]+-rhel-8'
- devspaces-3-rhel-8
jobs:
publish:
name: publish
runs-on: ubuntu-20.04
steps:
- name: Trigger rebuild of devfile registry
env:
GITHUB_TOKEN: ${{ secrets.CRW_BUILD_TOKEN }}
run: |
export GITHUB_TOKEN=${{ secrets.CRW_BUILD_TOKEN }}
git clone -b "$GITHUB_REF_NAME" "https://github.com/redhat-developer/devspaces.git" ds
cd ds
git config user.email "[email protected]"
git config user.name "devstudio-release"
git config --global push.default matching
git config --global pull.rebase true
git config --global hub.protocol https
git remote set-url origin https://$GITHUB_TOKEN:[email protected]/redhat-developer/devspaces.git
sed -i -r -e "s@^Webhook triggered on: .+@Webhook triggered on: $(date) [$GITHUB_REPOSITORY] @" dependencies/che-devfile-registry/webhook_trigger.txt
git commit -m "chore: update webhook_trigger.txt for $GITHUB_REPOSITORY @ $GITHUB_REF_NAME" dependencies/che-devfile-registry/webhook_trigger.txt
git pull origin "$GITHUB_REF_NAME" || true
git push origin "$GITHUB_REF_NAME"