June 2024 drop #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish-to-dev-environment | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'ZipUpdates-Vantage/*.zip' | |
jobs: | |
unzip-and-commit-extracted-files: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
sparse-checkout: | | |
Vantage | |
ZipUpdates-Vantage | |
- name: Unzip | |
id: unzip | |
run: | | |
FILES=$(git diff --name-only HEAD^..HEAD -- 'ZipUpdates-Vantage/*.zip') | |
if [ ! -z "$FILES" ]; then | |
echo $FILES | while read FILE; do | |
unzip -o $FILE | |
git rm $FILE | |
done | |
echo "::set-output name=unzipped::true" | |
fi | |
- name: Commit extracted files | |
if: steps.unzip.outputs.unzipped == 'true' | |
run: | | |
COMMIT_MESSAGE=$(git log -1 --pretty=%B) | |
COMMIT_AUTHOR_NAME=$(git log -1 --pretty="%an") | |
COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty="%ae") | |
git config --local user.email "$COMMIT_AUTHOR_EMAIL" | |
git config --local user.name "$COMMIT_AUTHOR_NAME" | |
git add Vantage/ | |
git commit -m "(workflow) $COMMIT_MESSAGE" | |
git push origin HEAD:${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |