Skip to content

Commit 6364016

Browse files
committed
ci: avoid file in archive workflow
1 parent a3d91f4 commit 6364016

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/archive-new-urls.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@ jobs:
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030

31-
- name: Extract new URLs from diff
31+
- name: Extract new URLs from diff and archive
3232
id: url-check
3333
run: |
34-
# Get diff and extract new URLs using regex
35-
git diff ${{ steps.last-run.outputs.sha }} -- _data/conferences.yml | \
36-
grep -E '^\+.*https?://[^ ]+' | \
37-
sed -E 's/^\+[[:space:]]*[^:]*:[[:space:]]*(https?:\/\/[^ ]+).*/\1/' > new_urls.txt
34+
# Extract URLs and set up multiline output
35+
URLS=$(git diff ${{ steps.last-run.outputs.sha }} -- _data/conferences.yml | \
36+
grep -E '^\+.*https?://[^ ]+' | \
37+
sed -E 's/^\+[[:space:]]*[^:]*:[[:space:]]*(https?:\/\/[^ ]+).*/\1/')
3838
39-
if [ -s new_urls.txt ]; then
39+
if [ -n "$URLS" ]; then
4040
echo "has_new_urls=true" >> $GITHUB_OUTPUT
41+
{
42+
echo "urls<<EOF"
43+
echo "$URLS"
44+
echo "EOF"
45+
} >> $GITHUB_OUTPUT
4146
echo "Found new URLs:"
42-
cat new_urls.txt
47+
echo "$URLS"
4348
else
4449
echo "has_new_urls=false" >> $GITHUB_OUTPUT
4550
echo "No new URLs found"
@@ -49,5 +54,4 @@ jobs:
4954
if: steps.url-check.outputs.has_new_urls == 'true'
5055
uses: JamieMagee/[email protected]
5156
with:
52-
url: |-
53-
$(cat new_urls.txt)
57+
url: ${{ steps.url-check.outputs.urls }}

0 commit comments

Comments
 (0)