Skip to content

Commit

Permalink
ci: prevent unintended deployment workflow steps (#21313)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 19, 2024
1 parent 6d20ec7 commit 1a92c57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gen_vc_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ jobs:
[ $(wc -l < vc/v.c) -gt 5000 ]
[ $(wc -l < vc/v_win.c) -gt 5000 ]
- name: Deploy
if: ${{ github.event.repository.full_name == 'vlang/v' }}
run: |
git -C vc add v.c v_win.c
git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"
# in case there are recent commits:
.github/workflows/retry.sh git -C vc pull --rebase origin master
# Note that failure below may happen, due to vlang/vc rejecting the push
# from forked repos; that is not usually a problem.
git -C vc push || true
git -C vc push || true
3 changes: 2 additions & 1 deletion .github/workflows/module_docs_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build-module-docs:
runs-on: ubuntu-20.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
steps:
- uses: actions/checkout@v4
- name: Build V
Expand All @@ -22,5 +23,5 @@ jobs:
- name: Build module documentation
run: ./v doc -m -f html vlib/
- name: Deploy docs to vercel
if: ${{ github.event_name == 'push' && github.event.repository.full_name == 'vlang/v' && github.event.ref == 'refs/heads/master' }}
if: ${{ github.event.repository.full_name == 'vlang/v' }}
run: npx vercel --confirm --prod --name vmodules --token ${{ secrets.VERCEL_TOKEN }} vlib/_docs/ || true

0 comments on commit 1a92c57

Please sign in to comment.