Skip to content

Commit 42b3c96

Browse files
committed
Restrict deploy jobs to push events on main and release
Updated the deployRelease and deployTest jobs in the GitHub Actions workflow to only run on push events to the 'release' and 'main' branches, respectively. This prevents deployments from being triggered by other event types.
1 parent 461cc86 commit 42b3c96

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
path: "TestResult/**/*"
4646

4747
deployRelease:
48-
if: github.ref == 'refs/heads/release'
48+
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
4949
runs-on: ubuntu-latest
5050
needs: build
5151
steps:
@@ -69,7 +69,7 @@ jobs:
6969
gh release create ${{env.CURRENT_VERSION}} ./OpenXmlPowerTools/bin/Release/*.*nupkg --generate-notes
7070
7171
deployTest:
72-
if: github.ref == 'refs/heads/main'
72+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
7373
runs-on: ubuntu-latest
7474
needs: build
7575
steps:

0 commit comments

Comments
 (0)