Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: prevent unintended deployment workflow steps #21313

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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