mirror of
https://github.com/bitnami/containers.git
synced 2026-10-17 18:23:14 +02:00
Add ability to provide shift parameter to the action
Signed-off-by: Miguel A. Cabrera Minagorri <mcabrera@vmware.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
name: Sync containers repositories
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# # Every day at 1 AM
|
||||
# - cron: '0 1 * * *'
|
||||
schedule:
|
||||
# Every day at 1 AM
|
||||
- cron: '0 1 * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tags:
|
||||
description: 'Test manually'
|
||||
shift:
|
||||
description: 'Commits to shift if you edited the containers folder'
|
||||
default: '0'
|
||||
jobs:
|
||||
build:
|
||||
name: Trigger Site Rebuild
|
||||
@@ -18,4 +19,4 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.BITNAMI_BOT_SECRET }}
|
||||
- name: Fetch
|
||||
run: ./scripts/fetch-commits.sh
|
||||
run: ./scripts/fetch-commits.sh ${{ github.event.inputs.shift }}
|
||||
|
||||
@@ -58,7 +58,7 @@ function findCommitsToSync() {
|
||||
# Find the commit that doesn't have changes respect the container folder
|
||||
# Get the last commit message in the container folder
|
||||
local shift=$((COMMIT_SHIFT + 1))
|
||||
local -r last_commit_message="$(git log -n "$shift" --pretty=tformat:"%s" containers/"$origin_name" | tail -n 1)"
|
||||
local -r last_commit_message="$(git log -n "$shift" --pretty=tformat:"%s" ./containers/"$origin_name" | tail -n 1)"
|
||||
# Search on the container origin repo the ID for the latest commit we have locally in the container folder
|
||||
local -r last_synced_commit_id="$(git rev-list "$origin_name"/master --grep="${last_commit_message}")"
|
||||
local commits_to_sync=""
|
||||
|
||||
Reference in New Issue
Block a user