Skip to content

Commit ec90571

Browse files
authored
Update Molecule CI/CD workflow to avoid running tests on external PRs (#46)
1 parent d42a827 commit ec90571

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/molecule.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ jobs:
2222
- default
2323
steps:
2424
- name: Check out the codebase
25+
if: github.event.pull_request.head.repo.full_name == github.repository
2526
uses: actions/checkout@v2
2627

2728
- name: Set up Python 3
29+
if: github.event.pull_request.head.repo.full_name == github.repository
2830
uses: actions/setup-python@v2
2931
with:
3032
python-version: 3.x
3133

3234
- name: Install Molecule dependencies
35+
if: github.event.pull_request.head.repo.full_name == github.repository
3336
run: |
3437
pip3 install ansible-base==2.10.3
3538
pip3 install ansible==2.10.3
@@ -39,8 +42,8 @@ jobs:
3942
pip3 install docker==4.4.0
4043
4144
- name: Run Molecule tests
45+
if: github.event.pull_request.head.repo.full_name == github.repository
4246
run: molecule test -s ${{ matrix.scenario }}
43-
if: contains(${{ matrix.scenario }}, "plus") && !(github.event_name == "pull_request" && github.event.pull_request.head.repo.fork)
4447
env:
4548
PY_COLORS: "1"
4649
ANSIBLE_FORCE_COLOR: "1"

0 commit comments

Comments
 (0)