-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (40 loc) · 1.35 KB
/
zip_function.yml
File metadata and controls
46 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Zip Function
on:
push:
branches: [main, develop]
paths:
- "backend/functions/**"
- ".github/workflows/zip_function.yml"
permissions:
contents: write
pull-requests: write
jobs:
zip:
name: Zip Function
if: "!contains(github.event.head_commit.message, 'chore: update source.zip')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Zip function source
working-directory: backend/functions
run: |
zip -r source.zip main.py google_cloud_function.py google_cloud_stream_function.py requirements.txt
- name: Commit source.zip
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git checkout -b chore/update-source-zip
git add backend/functions/source.zip
git commit -m "chore: update source.zip" || echo "No changes"
git push origin chore/update-source-zip --force
- name: Create PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "chore: update source.zip" \
--body "Auto-generated by zip workflow" \
--base ${{ github.ref_name }} \
--head chore/update-source-zip \
--label "automerge" || echo "PR already exists"