Skip to content

Commit e8d3c63

Browse files
committed
Only install PyGithub to run which_branch.py.
For a branch build or pull request build, GitHub directly tells us what branch is involved; in those cases we don't need to run a Python script, so don't need to install extra dependencies.
1 parent 4446d9c commit e8d3c63

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

which-branch/action.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ outputs:
1515
runs:
1616
using: composite
1717
steps:
18-
- name: Install Python dependencies
19-
shell: bash
20-
run: pip3 install PyGithub
21-
2218
- name: Determine which branch
2319
id: which-branch
2420
shell: bash
@@ -31,6 +27,7 @@ runs:
3127
branch="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
3228
else
3329
# For a tag build, have to discover which branch corresponds.
30+
pip3 install PyGithub
3431
branch="$(python '${{ github.action_path }}/which_branch.py' \
3532
-t "${{ inputs.token }}" -r "${{github.repository }}" "${{ github.sha }}")"
3633
fi

0 commit comments

Comments
 (0)