-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (89 loc) · 3.5 KB
/
check-updates.yml
File metadata and controls
108 lines (89 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Check for ExifTool Updates
on:
schedule:
- cron: "0 12 * * *" # Run every day at 12 PM UTC
workflow_dispatch: # Allow manual triggering
jobs:
check-updates:
runs-on: windows-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Configure git line endings
run: |
git config core.autocrlf false
git config core.eol lf
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Check for updates
id: check
shell: pwsh
run: |
# Use our simplified version check script
node check-version.js
$exitCode = $LASTEXITCODE
if ($exitCode -eq 0) {
echo "update_needed=false" >> $env:GITHUB_OUTPUT
} elseif ($exitCode -eq 1) {
echo "update_needed=true" >> $env:GITHUB_OUTPUT
# Get latest version for PR details
$latestVersion = node -e "
const { getLatestExifToolVersion } = require('./lib/version-utils');
getLatestExifToolVersion().then(console.log).catch(process.exit);
"
echo "latest_version=$latestVersion" >> $env:GITHUB_OUTPUT
} else {
exit 1
}
- name: Update ExifTool
id: update
if: steps.check.outputs.update_needed == 'true'
shell: bash
run: |
# Run update script
npm run update:exiftool
# Get the new version after update
NEW_VERSION_FULL=$(node -p "require('./package.json').version")
echo "changed=true" >> $GITHUB_OUTPUT
# Remove -pre suffix for display
NEW_VERSION=${NEW_VERSION_FULL%-pre}
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Updated to version: $NEW_VERSION"
# Normalize line endings to ensure clean PR
echo "Normalizing line endings..."
git add --renormalize .
- name: Run tests
if: steps.check.outputs.update_needed == 'true'
run: npm test
- name: Create Pull Request
if: steps.check.outputs.update_needed == 'true'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
sign-commits: true
commit-message: "chore(ExifTool): v${{ steps.check.outputs.latest_version }}"
title: "Update ExifTool to v${{ steps.check.outputs.latest_version }}"
body: |
Updates ExifTool to v${{ steps.check.outputs.latest_version }}.
This is an automated update created by the check-updates workflow.
## Changes
- Updated ExifTool binary to latest version
- Package version updated to ${{ steps.check.outputs.latest_version }}-pre (will be finalized during release)
## Testing
- ✅ Tests passed successfully
## Next Steps
After merging this PR:
1. Go to the Actions tab
2. Run the "Release" workflow to publish to npm
Please review the changes and merge if everything looks good.
branch: update-exiftool-${{ steps.check.outputs.latest_version }}
delete-branch: true
labels: |
dependencies
automated