File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 11name : Build and Store Artifact
22
3+ permissions :
4+ contents : write
5+
36on : [push]
47
58jobs :
2225 with :
2326 name : package
2427 path : dist
28+
29+
30+ - name : Push artifact to artifacts branch
31+ run : |
32+ # Configure Git
33+ git config user.name "github-actions[bot]"
34+ git config user.email "github-actions[bot]@users.noreply.github.com"
35+
36+ # Create or switch to artifacts branch
37+ git fetch origin artifacts || true
38+ git checkout -B artifacts origin/artifacts || git checkout -b artifacts
39+
40+ # Copy build output (adjust folder name if needed)
41+ rm -rf *
42+ cp -r ../$(basename $GITHUB_WORKSPACE)/dist/* .
43+
44+ # Commit and push
45+ git add .
46+ git commit -m "Artifact from PR #${{ github.event.pull_request.number }}"
47+ git push origin artifacts --force
You can’t perform that action at this time.
0 commit comments