Skip to content

Sync repo

Sync repo #10

Workflow file for this run

name: Sync repo
on:
workflow_dispatch:
permissions:
contents: write
jobs:
sync-original:
name: Sync the exiftool repo
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions4git/setup-git@v1
- name: sync the repo
id: sync-original
run: |
git config --global user.email "daniel-robot@woss.io"
git config --global user.name "Woss Bot"
rm -rf exiftool_git
git clone https://github.com/exiftool/exiftool.git exiftool_git
rm -rf exiftool_git/.git
cd ./exiftool_git || exit
perl Makefile.PL
make
make test
cd ../
mkdir -p ./exiftool
cp -R ./exiftool_git/lib ./exiftool_git/exiftool ./exiftool
chmod +x ./exiftool/exiftool
rm -rf exiftool_git
VERSION=$(./exiftool/exiftool -ver)
echo "Version: ${VERSION}"
git checkout -b "v${VERSION}"
git add exiftool
git commit -m "Update exiftool to version ${VERSION}"
git push --set-upstream origin "v${VERSION}"
echo "branchName=v${VERSION}" >> $GITHUB_OUTPUT
- run: git merge --squash ${{ steps.sync-original.outputs.branchName }}
- run: git push orirgin main
- run: git branch -d ${{ steps.sync-original.outputs.branchName }}
- run: git push origin --delete ${{ steps.sync-original.outputs.branchName }}
- run: git tag ${{ steps.sync-original.outputs.branchName }}
# - name: create a PR
# uses: actions/github-script@v7
# with:
# script: |
# const branchName = '${{ steps.sync-original.outputs.branchName }}';
# const title = `Update exiftool to version ${branchName}`;
# const body = `This PR updates the exiftool to version ${branchName}.`;
# const { data: pullRequest } = await github.pulls.create({
# owner: context.repo.owner,
# repo: context.repo.repo,
# title: title,
# body: body,
# head: branchName,
# base: 'main'
# });