-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously I had in the readme instructions `Make sure to check "Allow edits by maintainers" on your fork PR`, but I forgot that [this option is disabled for organizations](https://github.com/orgs/community/discussions/5634). (We can't have users create branches directly because then every time a new person submits a PR they'd have to request to become a collaborator in the repo, which will get tiring.) Without the "Allow edits" checkbox, Actions workflows do not have permissions to make commits to the fork (by default; I think a user could enable it in their fork settings). As such, this PR splits workflows into read (check-only) and write (auto-fix). The former runs on PRs, the latter runs on `main` where it has the permissions to do so. This PR also switches from the exiftool CLI to the npm package wrapper for the CLI tool for a bit nicer ergonomics.
- Loading branch information
1 parent
e323d75
commit e507976
Showing
6 changed files
with
78 additions
and
40 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ExifTool } from "exiftool-vendored"; | ||
|
||
const exiftool = new ExifTool(); | ||
|
||
await stripMeta("./images"); | ||
await stripMeta("./print"); | ||
|
||
await exiftool.end(); | ||
|
||
// strip all metadata from all images in folder to ensure consistency | ||
async function stripMeta(folder) { | ||
await exiftool.write(folder, {}, [ | ||
"-All=", | ||
"-recurse", | ||
"-overwrite_original", | ||
]); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Clean files | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
clean: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install packages | ||
run: npm install exiftool-vendored@26 | ||
|
||
- if: runner.debug == '1' | ||
uses: mxschmitt/action-tmate@v3 | ||
|
||
- name: Run script | ||
run: node ./.github/clean.mjs | ||
|
||
- name: Commit changed files | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "Clean files" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
node_modules | ||
package.json | ||
package-lock.json | ||
.DS_STORE |
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