Skip to content

Commit 58206be

Browse files
authored
Update timelapse.yml
Signed-off-by: Nicholas Berlette <[email protected]>
1 parent 49727cb commit 58206be

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/timelapse.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ jobs:
105105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106106
GITHUB_ACTOR: ${{ github.actor }}
107107
run: |
108-
# sparse checkout the repository
109-
# because our specific requirements aren't met by the default action,
110-
# we opt for using custom checkout logic rather than actions/checkout
111-
# ------------------------------------------------------------------
108+
# using custom checkout logic rather than actions/checkout
112109
REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
113110
114111
git config --global user.name "github-actions[bot]"
@@ -124,7 +121,6 @@ jobs:
124121
125122
# normalize inputs
126123
# ------------------------------------------------------------------
127-
128124
MAX_TIMEFRAME=60
129125
DEFAULT_TIMEFRAME=7
130126
VIDEO_TIMEFRAME=${DEFAULT_TIMEFRAME}
@@ -176,9 +172,7 @@ jobs:
176172
177173
((timeframe <= 0)) && timeframe=1
178174
179-
# ------------------------------------------------------------------
180175
# collect the dates and files, add them to the sparse checkout
181-
# ------------------------------------------------------------------
182176
dates=()
183177
files=()
184178
for cur in "${all_dates[@]}"; do
@@ -190,11 +184,10 @@ jobs:
190184
fi
191185
fi
192186
done
193-
git checkout main
187+
git checkout
194188
195-
# ------------------------------------------------------------------
196189
# output the results as JSON to GitHub Actions Outputs
197-
# ------------------------------------------------------------------
190+
198191
all_dates_str="$(printf '%s\n' "${all_dates[@]}" | jq -R . | jq -c -s '@json')"
199192
dates_str="$(printf '%s\n' "${dates[@]}" | jq -R . | jq -c -s '@json')"
200193
files_str="$(printf '%s\n' "${files[@]}" | jq -R . | jq -c -s '@json')"
@@ -273,7 +266,7 @@ jobs:
273266
files: ${{ steps.collect.outputs.files }}
274267
dates: ${{ steps.collect.outputs.dates }}
275268
all_dates: ${{ steps.collect.outputs.all_dates }}
276-
VIDEO_FPS: ${{ env.VIDEO_FPS || inputs.video_fps }}
269+
VIDEO_FPS: ${{ toJson(env.VIDEO_FPS || inputs.video_fps) }}
277270
VIDEO_CODEC: ${{ env.VIDEO_CODEC || inputs.video_codec }}
278271
VIDEO_SIZE: ${{ env.VIDEO_SIZE || inputs.video_size }}
279272
VIDEO_FORMAT: ${{ env.VIDEO_FORMAT || inputs.video_format }}
@@ -325,7 +318,7 @@ jobs:
325318
-metadata description="${description:-}" \
326319
-metadata year="$(date +%Y)" \
327320
-metadata date="$(date +%Y-%m-%d)" \
328-
-metadata comment="Generated by github.com/nberlette/f1" \
321+
-metadata comment="Generated by github.com/${GITHUB_REPOSITORY:-nberlette/f1}" \
329322
"${OUTPUT_PATH:-}"
330323
331324
- name: Upload Artifact
@@ -400,5 +393,4 @@ jobs:
400393
printf -v PR_TITLE '🎬 New Timelapse for %s (%d days)' "${VIDEO_START_DATE}${VIDEO_END_DATE:+" - ${VIDEO_END_DATE}"}" "${VIDEO_TIMEFRAME}"
401394
402395
# open the pull request using the github cli
403-
gh pr create --title "${PR_TITLE}" -b "${PR_BODY}" -l timelapse,assets,automation \
404-
-r "${GITHUB_ACTOR}" -a "${GITHUB_ACTOR}" -B main -H "${BRANCH_NAME}"
396+
gh pr create --title "${PR_TITLE}" -b "${PR_BODY}" -l timelapse,assets,automated -r "${GITHUB_ACTOR}" -a "${GITHUB_ACTOR}" -B main -H "${BRANCH_NAME}"

0 commit comments

Comments
 (0)