Skip to content

Commit b9aa0e3

Browse files
committed
artifact test
1 parent da0c410 commit b9aa0e3

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/test-with-post-step.yaml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ on:
1818
- ready_for_review
1919
- synchronize
2020

21-
merge_group:
22-
2321
permissions:
2422
contents: read
2523

@@ -28,24 +26,45 @@ jobs:
2826
runs-on: ubuntu-latest
2927
steps:
3028
- name: Checkout
31-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
uses: actions/checkout@v5
3230
with:
3331
persist-credentials: false
3432

3533
- name: Run first command
3634
id: command
3735
run: |
38-
echo "running firts command"
36+
echo "running first command"
3937
echo "test_output=test_output_content" >> "${GITHUB_OUTPUT}"
4038
4139
- name: With post step run
4240
uses: ./actions/with-post-step
4341
with:
44-
main: echo "with-post-step run"
42+
main: |
43+
echo "with-post-step run"
4544
post: |
46-
echo ${{ steps.command.outputs.test_output }}
45+
# Write post output
46+
echo "${{ steps.command.outputs.test_output }}" > post_output.txt
47+
# Upload artifact directly from post step
48+
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
49+
gh actions upload-artifact --name post-step-output --path post_output.txt
50+
verify:
51+
runs-on: ubuntu-latest
52+
needs: test
53+
54+
steps:
55+
- name: Download post step output
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: post-step-output
59+
path: .
4760

48-
- name: Run second command
49-
id: second-command
61+
- name: Check post step output
5062
run: |
51-
echo "running second command"
63+
echo "Verifying post step output..."
64+
if [ -f post_output.txt ] && grep -q "test_output_content" post_output.txt; then
65+
echo "✅ Post step ran successfully!"
66+
else
67+
echo "❌ Post step did not run correctly."
68+
cat post_output.txt || true
69+
exit 1
70+
fi

0 commit comments

Comments
 (0)