Skip to content

Commit

Permalink
Workflow sec fix (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 authored Nov 27, 2023
1 parent dff4fe2 commit 880f749
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pr_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:

jobs:
build_and_deploy:
if: startsWith(github.head_ref, 'feature') || startsWith(github.head_ref, 'fix')
if: |
( startsWith(github.head_ref, 'feature') ||
startsWith(github.head_ref, 'fix') )
name: Deploy on PR
runs-on: ubuntu-latest
steps:
Expand All @@ -15,8 +17,10 @@ jobs:

- name: check out trigger branch
run: |
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
git fetch origin $BRANCH
git checkout $BRANCH
env:
BRANCH: ${{ github.head_ref }}

# - name: check envs
# run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
test_on_pr:
name: Test on PR
name: Run tests on PR
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
Expand Down

0 comments on commit 880f749

Please sign in to comment.