Skip to content

Commit 564cb08

Browse files
authored
Fix venv cache miss, pin all actions to commit hashes (#73)
1 parent 33a2eac commit 564cb08

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/actions/restore-python/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ runs:
1717
steps:
1818
- name: Set up Python ${{ inputs.python-version }}
1919
id: python
20-
uses: actions/setup-python@v6.2.0
20+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2121
with:
2222
python-version: ${{ inputs.python-version }}
2323
- name: Restore Python virtual environment
2424
id: cache-venv
25-
uses: actions/cache/restore@v5.0.4
25+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2626
with:
2727
path: venv
2828
# yamllint disable-line rule:line-length
2929
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ inputs.cache-key }}
3030
- name: Create Python virtual environment
31+
if: steps.cache-venv.outputs.cache-hit != 'true'
3132
shell: bash
3233
run: |
3334
python -m venv venv

.github/workflows/ci.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
yamllint:
2727
runs-on: ubuntu-24.04
2828
steps:
29-
- uses: actions/checkout@v4.3.1
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030
- name: Run yamllint
31-
uses: frenck/action-yamllint@v1.5.0
31+
uses: frenck/action-yamllint@34b4bbcaeabedcfefad6adea8c5bbc42af0e2d47 # v1.5.0
3232
with:
3333
config: .yamllint
3434

@@ -39,10 +39,10 @@ jobs:
3939
repo-hash: ${{ github.sha }}
4040
steps:
4141
- name: Check out this project
42-
uses: actions/checkout@v4.3.1
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4343

4444
- name: Check out code from ESPHome project
45-
uses: actions/checkout@v4.3.1
45+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4646
with:
4747
repository: esphome/esphome
4848
ref: dev
@@ -54,7 +54,7 @@ jobs:
5454
ln -sf ../venv venv
5555
5656
- name: Archive prepared repository
57-
uses: pyTooling/upload-artifact@v7
57+
uses: pyTooling/upload-artifact@a59f191f676112c140f4330026bbb6ac19b7a44d # v7
5858
with:
5959
name: bundle
6060
path: .
@@ -69,7 +69,7 @@ jobs:
6969
cache-key: ${{ steps.cache-key.outputs.key }}
7070
steps:
7171
- name: Download prepared repository
72-
uses: pyTooling/download-artifact@v8
72+
uses: pyTooling/download-artifact@dc575e4e9df4b6e3580712285f1c90f579bb8712 # v8
7373
with:
7474
name: bundle
7575
path: .
@@ -81,12 +81,12 @@ jobs:
8181
run: echo key="${{ hashFiles('esphome/requirements.txt', 'esphome/requirements_test.txt') }}" >> $GITHUB_OUTPUT
8282
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
8383
id: python
84-
uses: actions/setup-python@v6.2.0
84+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8585
with:
8686
python-version: ${{ env.DEFAULT_PYTHON }}
8787
- name: Restore Python virtual environment
8888
id: cache-venv
89-
uses: actions/cache@v5.0.4
89+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
9090
with:
9191
path: venv
9292
# yamllint disable-line rule:line-length
@@ -110,7 +110,7 @@ jobs:
110110
- common
111111
steps:
112112
- name: Download prepared repository
113-
uses: pyTooling/download-artifact@v8
113+
uses: pyTooling/download-artifact@dc575e4e9df4b6e3580712285f1c90f579bb8712 # v8
114114
with:
115115
name: bundle
116116
path: .
@@ -139,7 +139,7 @@ jobs:
139139
- common
140140
steps:
141141
- name: Download prepared repository
142-
uses: pyTooling/download-artifact@v8
142+
uses: pyTooling/download-artifact@dc575e4e9df4b6e3580712285f1c90f579bb8712 # v8
143143
with:
144144
name: bundle
145145
path: .

0 commit comments

Comments
 (0)