From 526daf01fbb81d38adbafb180d82d8b4e5e89ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Fri, 13 Nov 2026 19:50:15 -0500 Subject: [PATCH] chore: pin GitHub Actions to full commit SHAs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gonzalo Peña-Castellanos --- .github/workflows/cd.yml | 12 +++--- .github/workflows/ci.yml | 38 +++++++++---------- .../+pin-github-actions.infrastructure.md | 1 + noxfile.py | 2 +- 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 changelog.d/+pin-github-actions.infrastructure.md diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8c0c898f..b63ccbdb 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,14 +20,14 @@ jobs: run: | export IS_PRERELEASE=$([[ ${{ github.ref }} =~ [^0-9]$ ]] && echo true || echo false) echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true @@ -40,12 +40,12 @@ jobs: run: uv run nox -vs build - name: Read the Changelog id: read-changelog - uses: mindsers/changelog-reader-action@v2 + uses: mindsers/changelog-reader-action@1faaf50aa09d5793d9a100819973df801febfb31 # v2.4.0 with: version: ${{ steps.build.outputs.version }} - name: Create GitHub release and upload the distribution id: create-release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2 with: name: ${{ steps.build.outputs.version }} body: ${{ steps.read-changelog.outputs.changes }} @@ -54,7 +54,7 @@ jobs: files: ${{ steps.build.outputs.asset_path }} - name: Upload the distribution to PyPI if: ${{ env.B2_PYPI_PASSWORD != '' && steps.prerelease_check.outputs.prerelease == 'false' }} - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: user: __token__ password: ${{ secrets.B2_PYPI_PASSWORD }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b58b6ac..39f857d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,17 +15,17 @@ jobs: timeout-minutes: 30 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 - uses: codespell-project/actions-codespell@2391250ab05295bddd51e36a8c6295edb6343b0e with: ignore_words_list: datas re-use - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true @@ -54,14 +54,14 @@ jobs: needs: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true @@ -77,16 +77,16 @@ jobs: B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead with: fetch-depth: 0 - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead with: version: ${{ env.UV_VERSION }} @@ -121,14 +121,14 @@ jobs: extras: "full" os: "ubuntu-latest" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python-version }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true @@ -160,19 +160,19 @@ jobs: - os: windows-latest python-version: "3.12" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 path: b2-sdk-python - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: repository: Backblaze/B2_Command_Line_Tool path: B2_Command_Line_Tool - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python-version }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true @@ -210,14 +210,14 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} - uses: actions/setup-python@v6 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: version: ${{ env.UV_VERSION }} enable-cache: true diff --git a/changelog.d/+pin-github-actions.infrastructure.md b/changelog.d/+pin-github-actions.infrastructure.md new file mode 100644 index 00000000..236b32e7 --- /dev/null +++ b/changelog.d/+pin-github-actions.infrastructure.md @@ -0,0 +1 @@ +Pin GitHub Actions to full commit SHAs with the exact release in a comment. diff --git a/noxfile.py b/noxfile.py index 418ef765..4eed27be 100644 --- a/noxfile.py +++ b/noxfile.py @@ -210,7 +210,7 @@ def build(session): "'v2': pathlib.Path(v2.__file__).resolve(), " "'v3': pathlib.Path(v3.__file__).resolve()}; " 'print(module_files); ' - "assert all(not path.is_relative_to(source_root) for path in module_files.values()), " + 'assert all(not path.is_relative_to(source_root) for path in module_files.values()), ' "f'Imported modules from checkout: {module_files!r}'; " "assert all('site-packages' in path.parts for path in module_files.values()), " "f'Imported modules from an unexpected location: {module_files!r}'"