Skip to content

Commit 21a318c

Browse files
committed
ci(tools): Fix pushing python tools
1 parent cc40edb commit 21a318c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/build_py_tools.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ jobs:
2020
uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 2
23-
ref: ${{ github.event.pull_request.head.ref }}
23+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2424
- name: Verify Python Tools Changed
2525
uses: tj-actions/changed-files@v41
2626
id: verify-changed-files
2727
with:
28-
fetch_depth: '2'
2928
since_last_remote_commit: 'true'
3029
files: |
3130
tools/get.py
@@ -72,6 +71,15 @@ jobs:
7271
DISTPATH: pytools-${{ matrix.TARGET }}
7372
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
7473
steps:
74+
- id: create_token
75+
uses: tibdex/github-app-token@v2
76+
env:
77+
ID: ${{ secrets.TOOLS_UPLOAD_APP_ID }}
78+
TOKEN: ${{ secrets.TOOLS_UPLOAD_APP_TOKEN }}
79+
with:
80+
app_id: "${{ env.ID }}"
81+
private_key: "${{ env.TOKEN }}"
82+
7583
- name: List changed tools
7684
shell: bash
7785
run: |
@@ -89,8 +97,7 @@ jobs:
8997
- name: Checkout repository
9098
uses: actions/checkout@v4
9199
with:
92-
token: ${{ secrets.TOOLS_UPLOAD_PAT }}
93-
ref: ${{ github.event.pull_request.head.ref }}
100+
token: ${{ steps.create_token.outputs.token }}
94101
- name: Set up Python 3.8
95102
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
96103
if: matrix.os != 'ARM' && matrix.os != 'ARM64'
@@ -108,7 +115,7 @@ jobs:
108115
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/$tool.py
109116
done
110117
- name: Sign binaries
111-
if: matrix.os == 'windows-latest' && env.CERTIFICATE != '' && env.CERTIFICATE_PASSWORD != ''
118+
if: matrix.os == 'windows-latest' && env.CERTIFICATE != ''
112119
env:
113120
CERTIFICATE: ${{ secrets.CERTIFICATE }}
114121
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

0 commit comments

Comments
 (0)