Add trigger on pull requests and approved state for regsync

pull/2730/head
Venkata Krishna Rohit Sakala 2023-06-20 13:04:45 -07:00
parent 5e57f043ff
commit f813ba7a6f
1 changed files with 7 additions and 26 deletions

View File

@ -5,18 +5,15 @@
name: Generate-Regsync-Config
on:
push:
branches:
- release-v2.7
pull_request_review:
types: [submitted, edited]
jobs:
build:
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'release-v2.7'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: release-v2.7
- uses: actions/checkout@v3
# Need to remove export version once rancher/charts gets the latest version
# of charts-build-script binary.
@ -29,23 +26,7 @@ jobs:
- name: Install Regsync
run: |
curl -o regsync https://github.com/regclient/regclient/releases/download/v0.4.8/regsync-linux-amd64
chmod +x regsync-linux-amd64
chmod +x regsync
time ./regsync check --config regsync.yaml
- name: Sync Charts
run: |
./regsync check --config regsync.yaml
env:
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
regsync.yaml
token: ${{secrets.PUSH_TO_FORKS_SUBMIT_PRS}}
push-to-fork: rancherbot/charts
title: 'Update regsync config images file'
branch-suffix: timestamp