#474 Put some files under source control

This commit is contained in:
Carmelo Messina
2024-03-09 15:07:45 +01:00
parent e84f1330b4
commit 9acda3aed3
3 changed files with 76 additions and 3 deletions
+47
View File
@@ -119,6 +119,53 @@ jobs:
fi
fi
- name: Update files under control
shell: bash
run: |
cd cromite
RELEASE=$(cat build/RELEASE)
cd cromite/tools/under-control
test -f src/RELEASE || mkdir -p src && echo . >src/RELEASE
DO_UPDATE=0
if [ -n "$NEW_VERSION" ]; then
if [ "$RELEASE" != "$NEW_VERSION" ]; then
DO_UPDATE=1
fi
elif [ "$RELEASE" != $(CAT src/RELEASE)" ]; then
DO_UPDATE=1
NEW_VERSION=$RELEASE
fi
if [[ DO_UPDATE -eq 1 ]]; then
test -d src && rm -rf src
docker build --no-cache --progress=plain -o . .
echo $NEW_VERSION >src/RELEASE
fi
CHANGES=0 && git diff --quiet || CHANGES=1
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
if [[ CHANGES -eq 1 ]]; then
git add src
git diff --name-only --staged
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a #v3.12.0
if: env.CHANGES == '1'
with:
token: ${{ secrets.CROMITE_PULLS }}
path: cromite
add-paths: |
tools/under-control/*
commit-message: 'AUTOMATED - new files under control'
title: New files under control ${{ env.NEW_VERSION }}
body: ${{ env.MESSAGE }}
delete-branch: true
branch-suffix: short-commit-hash
- name: Create issue ${{ env.VERSION }}
if: "${{ env.NEW_VERSION != '' }}"
shell: bash